Conversation
|
@nikita-ashihmin This first-time fork PR is ready to run CI at exact head |
|
@benbrandt could you please give a review on this PR. Could you approve those workflows and review the contribution shape? No existing ACP behavior changes for clients that do not negotiate/call the extension. |
|
@AlexandrSuhinin @Rizzen The merge conflict with upstream main has been resolved and pushed at exact head |
…ty-brid-6q9 # Conflicts: # src/CodexAcpClient.ts
|
@benbrandt @AlexandrSuhinin @Rizzen The current head is |
…ty-brid-6q9 # Conflicts: # src/CodexAcpServer.ts
|
@Ololoshechkin Could you review the current head |
|
@nikita-ashihmin The current fork-workflow runs for exact head |
Overview
codex-acpmaps Codex App Server commands and terminal output into ACP, but integrations that need terminal semantics cannot currently request a bounded one-shot TTY execution while preserving the active session context.This contribution adds a narrow, versioned extension that dispatches one command through the already-running App Server with
tty: true. It is implemented entirely insidecodex-acpand has no dependency on an external orchestration service.Why this is useful
Some command-line programs change behavior when no pseudo-terminal is present. Reusing the active Codex session gives the adapter an authoritative working directory and sandbox policy while avoiding a second executor or a caller-controlled security context.
The proposed bridge complements the existing command and terminal-event mapping:
Changes
1._kandev/guarded_tty/capability_kandev/guarded_tty/exec{ sessionId, argv }with strict argument-count, per-argument, total-byte, and NUL bounds.cwdandsandboxPolicyfrom the trusted active session.command/execwith TTY and streaming enabled.The current method prefix is retained from the originating implementation for compatibility. It does not introduce a runtime dependency; I am happy to rename it to an upstream-preferred experimental namespace during review.
Security boundaries
The request cannot control cwd, sandbox policy, permission profile, process ID, TTY flags, environment, stdin, resize, attach, or an interactive lifecycle. The change does not create a host executor, mutate Codex configuration, alter mounts or credentials, or enable unrelated execution surfaces.
Testing
npx vitest run src/__tests__/CodexACPAgent/guarded-tty-exec.test.ts src/__tests__/CodexACPAgent/terminal-output-events.test.ts --no-file-parallelism— 28 passednpm run typecheck— passednpm run build— passednpm test— 495 passed, 26 skippedgit diff --check origin/main...HEAD— passedCredentialed
npm run test:e2ewas not rerun because the required API keys are unavailable. Prior authenticated App Server probes verified TTY stdin/stdout,stty, trusted-worktreepwd, and exit code 0. Bun-only release bundling was not run because Bun is unavailable; the production build passed.Compatibility
No existing ACP or
codex-acpbehavior changes. Clients that do not negotiate and call this versioned extension continue using the existing command path.Screenshots
N/A — no UI-visible changes.