Managed settings, debug, and history
Scope: SessionRpc (per-session operations tied to a Session)
For an overview of RPC and the list of all RPC pages, see RPC.
debug (experimental)
Use debug()->collectLogs() to collect a session’s event logs, process logs, and shell logs into a .tgz archive or a directory. Logs are redacted for sensitive information by default. You can add files or directories with additionalEntries, and set redaction to plain-text, events-jsonl, or none. With none, nothing is redacted, so be careful about what you add.
Specify DebugCollectLogsDestination::directory('/tmp/copilot-debug') to output to a staging directory. With include, you can individually specify which logs and reference paths to collect, and you can check what was collected from entries and skippedEntries in the result. Destination and additional entry paths are paths on the CLI server side. In the standard setup where the CLI is started over stdio, that’s the same host as your app, but if you connect over TCP to a CLI server on another host, specify paths on the server side, not on the calling machine.
contentExclusion (experimental)
You can check whether local absolute paths in the session’s working directory are subject to content exclusion policies. Call this before reading or attaching file contents.
checkPaths() accepts only absolute paths, and the paths must be inside the session’s working directory. checks are returned in the same order as the input, and duplicate paths are kept as-is. If the path, file system, or policy evaluation isn’t supported or available, you get available: false and an empty checks. In that case, isExcluded() always returns true, so treat all paths as excluded. Even with available: true, paths missing from the result are conservatively treated as excluded.
Last modified on November 19, 2026