daemon: add Codex ask-mode permission backend#8
Open
MKV21 wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in Codex Ask Mode to the daemon so Codex app-server permission requests can pause a session, surface a structured pending permission, and resume after an explicit user decision. Auto mode remains the default-compatible path.
Ask Mode is selected with
permissionMode: "ask"or the CLI flagsession create --permission-mode ask. In Ask Mode, Codex sessions use the app-server backend with approval support instead of silently falling back to the CLI auto path.Changes
apps/daemon/src/types.ts— addspermissionMode,awaiting_approval, andpendingPermissionsession state.apps/daemon/src/sessionManager.ts— routes Codex Ask Mode through the app-server backend, stores pending permission requests, handles permission responses, and keeps abort/cancel state stable.apps/daemon/src/codexAppServerRunner.ts— handles server-initiated Codex JSON-RPC approval requests, normalizes them into daemon permission requests, and maps user decisions back to Codex responses.apps/daemon/src/nativeHistory/index.ts— preserves pending permission state when daemon sessions are exposed through the workspace/session catalog.apps/daemon/src/ipc.ts— addssession.permission.respondand validates permission-mode session creation input.apps/daemon/src/cli.ts— adds--permission-mode <auto|ask>for session creation andsession permission --decision <approve_once|reject|abort_run>.apps/daemon/src/scheduleManager.tsandapps/daemon/src/teamManager.ts— updatecreateSessioncalls for the new optional permission-mode parameter.apps/daemon/test/session-permissions.test.mjs— adds deterministic backend tests using a fake Codex app-server runner, including pending permission preservation in discovered sessions.apps/daemon/package.json— adds the daemon test script.Test plan
npm test --workspace @openvide/daemon./node_modules/.bin/tsc -p apps/daemon/tsconfig.jsonawaiting_approval,approve_onceresumed the turn, and the requested command completed.Notes
approve_oncemaps to the closest available Codex app-server decision. For broader permissions requests, Codex may apply the accepted permission for the current turn.AI disclosure
Parts of this change were drafted by Codex (AI coder) and reviewed by Claude Code (AI reviewer). A human (@MKV21) reviewed, tested, and approved the final result before submission.