Skip to main content
All bridges support continuing and resuming sessions.

Continue Latest Session

use Cognesy\AgentCtrl\AgentCtrl;

$response = AgentCtrl::codex()
    ->continueSession()
    ->execute('Continue from the previous plan and apply step 2.');
// @doctest id="2e32"

Resume Specific Session

use Cognesy\AgentCtrl\AgentCtrl;

$first = AgentCtrl::codex()->execute('Create a migration plan.');
$sessionId = $first->sessionId();

if ($sessionId !== null) {
    $next = AgentCtrl::codex()
        ->resumeSession((string) $sessionId)
        ->execute('Now implement the first migration.');
}
// @doctest id="6cdc"
sessionId() returns AgentSessionId|null.