Skip to content

[codex] Implement ACP auth and read/write session modes#35

Merged
nick-pape merged 2 commits into
mainfrom
codex/acp-auth-session-modes
Jun 11, 2026
Merged

[codex] Implement ACP auth and read/write session modes#35
nick-pape merged 2 commits into
mainfrom
codex/acp-auth-session-modes

Conversation

@nick-pape

Copy link
Copy Markdown
Owner

Summary

Implements the next minimum ACP surface slice for authentication and session modes.

Changes

  • Advertises no ACP auth methods with authMethods: [].
  • Rejects unsupported authenticate() calls instead of silently no-oping.
  • Adds read and write ACP session modes, with write as the default.
  • Persists session.mode_changed events and restores the latest mode during loadSession().
  • Emits ACP current_mode_update when setSessionMode() changes a session mode.
  • Filters known first-party mutating workspace tools from model turns in read mode.
  • Updates README and API reports.

Validation

  • pnpm test in packages/acp-agent
    • 4 test files passed
    • 26 tests passed
  • pnpm build in packages/acp-agent
  • node common/scripts/install-run-rush.js build --to @fledgling/acp-agent

Notes

Model selection remains separate work for #9. Permission prompts for writes/commands remain separate work for #13.

@nick-pape
nick-pape marked this pull request as ready for review June 10, 2026 22:08
Copilot AI review requested due to automatic review settings June 10, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the ACP agent surface area by explicitly advertising no authentication methods, adding read/write session modes (defaulting to write), persisting/restoring mode changes, and filtering mutating workspace tools from model turns while in read mode.

Changes:

  • Advertise authMethods: [] and reject unsupported authenticate() calls.
  • Add ACP session modes (read, write), persist session.mode_changed, restore mode during loadSession(), and emit current_mode_update.
  • Filter known first-party mutating workspace tools from the toolset presented to the model in read mode, plus docs/API/test updates.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Documents lack of ACP auth methods and describes read/write session modes and their behavior.
packages/common/src/session-events.ts Adds SessionModeChangedEvent to the persisted session event union.
packages/agent-core/src/agent.ts Implements auth rejection, session mode state, persistence/restoration, current_mode_update, and tool filtering by mode.
packages/acp-agent/src/agent-prompt-cancellation.test.ts Adds tests for authMethods, authenticate rejection, mode defaults/updates/persistence, and tool filtering behavior.
common/reviews/common.public.api.md Updates the public API report to include SessionModeChangedEvent.
common/reviews/agent-core.public.api.md Updates the public API report to reflect updated method signatures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/agent-core/src/agent.ts
Comment thread packages/acp-agent/src/agent-prompt-cancellation.test.ts
@nick-pape
nick-pape merged commit f49eb61 into main Jun 11, 2026
4 checks passed
@nick-pape
nick-pape deleted the codex/acp-auth-session-modes branch June 11, 2026 01:45
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.

2 participants