Skip to content

fix: initialize session mode from resolved Codex permissions - #739

Open
PedroScholemberg wants to merge 2 commits into
agentclientprotocol:mainfrom
PedroScholemberg:fix/respect-resolved-session-permissions
Open

PedroScholemberg wants to merge 2 commits into
agentclientprotocol:mainfrom
PedroScholemberg:fix/respect-resolved-session-permissions

Conversation

@PedroScholemberg

Copy link
Copy Markdown

Summary

Related to #702. Initialize a session mode using the sandbox, approval policy, and reviewer resolved by Codex when no explicit initial mode or active named permission profile takes precedence. Preserve non-preset policy combinations in a configured mode.

When an unprompted session is reloaded while its adapter session is still available, retain its selected mode, including a mode chosen by the client.

Limitation

If the adapter no longer has the session in memory, the fallback for an unmaterialized thread uses thread/read, which does not report permissions. The original mode cannot be recovered from that response; this PR does not cover that case.

Testing

  • npm run typecheck and npm run build passed.
  • Focused mode, session configuration, and unmaterialized-session tests: 56 passed.
  • Real Codex smoke prompt completed with end_turn; this did not verify each policy combination.
  • npm test on Windows: 2,368 passed, 88 failed, 47 skipped. One investigated failure expects Unix path separators and receives Windows separators; the causes of the other failures have not all been established. The full suite has not passed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant