> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Managed settings, debug, and history

> Use SessionRpc in Laravel Copilot SDK to work with managed settings, debug, contentExclusion, and history.

## 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](https://kawax.biz/en/packages/laravel-copilot-sdk/rpc.md).

## 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.

```php theme={null}
use Revolution\Copilot\Enums\DebugCollectLogsEntryKind;
use Revolution\Copilot\Enums\DebugCollectLogsRedaction;
use Revolution\Copilot\Types\Rpc\DebugCollectLogsDestination;
use Revolution\Copilot\Types\Rpc\DebugCollectLogsEntry;
use Revolution\Copilot\Types\Rpc\DebugCollectLogsRequest;

$result = $session->rpc()->debug()->collectLogs(new DebugCollectLogsRequest(
    destination: DebugCollectLogsDestination::archive('/tmp/copilot-debug.tgz', noOverwrite: true),
    additionalEntries: [
        new DebugCollectLogsEntry(
            kind: DebugCollectLogsEntryKind::File,
            path: '/var/log/my-app.log',
            bundlePath: 'application/my-app.log',
            redaction: DebugCollectLogsRedaction::PlainText,
            required: true,
        ),
    ],
));
```

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.

```php theme={null}
use Revolution\Copilot\Types\Rpc\ContentExclusionCheckPathsRequest;

$result = $session->rpc()->contentExclusion()->checkPaths(
    new ContentExclusionCheckPathsRequest(paths: [
        '/workspace/private.txt',
        '/workspace/public.txt',
    ]),
);

if ($result->isExcluded('/workspace/private.txt')) {
    // Excluded, or can't be determined safely.
}
```

`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.

```php theme={null}
// managedSettings (experimental: session managed settings)
// Get the snapshot currently held (doesn't wait for application or fetch anew)
$snapshot = $session->rpc()->managedSettings()->getCurrentSnapshot(); // ManagedSettingsResolvedData|null
// Wait until the current policy is applied / wait only until the policy is published
$session->rpc()->managedSettings()->awaitApplied();
$session->rpc()->managedSettings()->awaitPublished();
// Re-evaluate the Policy Helper and return the resulting effective settings
$settings = $session->rpc()->managedSettings()->recheckPolicyHelper(); // ManagedSettingsResolvedData

// compaction → renamed to history
$session->rpc()->history()->compact();
// Set the model, instructions, and reasoning effort used for compaction (experimental). Each call replaces all three; omitted fields revert to defaults
$session->rpc()->history()->setCompactionConfig(new HistorySetCompactionConfigRequest(
    model: 'gpt-5', // Optional. In BYOK/provider sessions, the session's model does the summarization
    prompt: 'Keep decisions only', // Optional. Replaces the built-in prompt
    reasoningEffort: ReasoningEffort::LOW, // Optional
));
// Abort manual compaction / cancel background compaction
$session->rpc()->history()->abortManualCompaction();
$session->rpc()->history()->cancelBackgroundCompaction();
// Get a summary for handing off to another session
$summary = $session->rpc()->history()->summarizeForHandoff()->summary;
// Truncate history from a specific event onward
$session->rpc()->history()->truncate(new HistoryTruncateRequest(
    eventId: 'evt-123', // This event and all later events are deleted
));
```


## Related topics

- [RPC (Remote Procedure Call)](https://kawax.biz/en/packages/laravel-copilot-sdk/rpc.md)
- [Settings and managed settings](https://kawax.biz/en/packages/laravel-copilot-sdk/rpc/server-settings.md)
- [SessionRpc overview](https://kawax.biz/en/packages/laravel-copilot-sdk/rpc/session-overview.md)
- [SessionConfig](https://kawax.biz/en/packages/laravel-copilot-sdk/session-config.md)
- [Laravel Cloud — a full look at the Laravel-native PaaS](https://kawax.biz/en/blog/laravel-cloud.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.