You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a narrow, versioned ACP extension that lets an authorized Kandev integration request a one-shot TTY command through the already-running Codex App Server process.
This closes the upstream ACP bridge gap only. Deployment authorization, audit persistence, and model-tool registration remain owned by Kandev; the deployment-only non-TTY repair is unchanged.
Changes
Advertise guarded-TTY capability version 1 and register:
_kandev/guarded_tty/capability
_kandev/guarded_tty/exec
Accept only { sessionId, argv } with strict count, per-argument, total-byte, and NUL bounds.
Derive cwd and sandboxPolicy from the active trusted ACP session.
Generate the process ID inside the bridge and dispatch App Server command/exec with tty: true, streaming enabled, and fixed timeout/output caps.
Correlate output by process ID, validate base64, preserve split UTF-8 output, and enforce a 64 KiB aggregate cap.
Return a stable, non-leaking receipt with capability/session/process/cwd/TTY/output/exit/timestamp evidence.
Terminate dispatched processes best-effort and idempotently on cancellation, stale session, timeout, overflow, invalid output, or App Server rejection.
Keep ordinary model commandExecution mapping and non-TTY output behavior unchanged.
Security boundaries
The extension does not accept caller-controlled cwd, sandbox policy, permission profile, process ID, TTY flags, environment, stdin/write/resize/attach, or interactive lifecycle controls. It does not create a host-side executor, mutate CODEX_CONFIG, enable unified_exec, or alter mounts or credentials.
Testing
npx vitest run src/__tests__/CodexACPAgent/guarded-tty-exec.test.ts src/__tests__/CodexACPAgent/terminal-output-events.test.ts --no-file-parallelism — 28 passed
npm run typecheck — passed
npm run build — passed
npm test — 495 passed, 26 skipped
git diff --check origin/main...HEAD — passed
Credentialed npm run test:e2e was not rerun because CODEX_API_KEY and OPENAI_API_KEY are unavailable. Prior ChatGPT-authenticated App Server probes verified TTY stdin/stdout, stty, the trusted worktree pwd, and exit code 0. Bun-only release bundling was not run because Bun is unavailable; the normal production build passed.
Breaking changes
None. This adds versioned underscore extension methods and does not change existing ACP command behavior.
@nikita-ashihmin This first-time fork PR is ready to run CI at exact head 1a5d8b9cf1f70a8677ead500088a8e022cdc65bb, but GitHub stopped both workflows at the fork-approval gate with zero jobs: CI run 33305349645 and Conventional PRs run 33305349647. Could you approve those workflow runs? This is only a workflow-approval request; I will wait for terminal green checks before requesting code review.
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
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.
Overview
Add a narrow, versioned ACP extension that lets an authorized Kandev integration request a one-shot TTY command through the already-running Codex App Server process.
This closes the upstream ACP bridge gap only. Deployment authorization, audit persistence, and model-tool registration remain owned by Kandev; the deployment-only non-TTY repair is unchanged.
Changes
1and register:_kandev/guarded_tty/capability_kandev/guarded_tty/exec{ sessionId, argv }with strict count, per-argument, total-byte, and NUL bounds.cwdandsandboxPolicyfrom the active trusted ACP session.command/execwithtty: true, streaming enabled, and fixed timeout/output caps.commandExecutionmapping and non-TTY output behavior unchanged.Security boundaries
The extension does not accept caller-controlled
cwd, sandbox policy, permission profile, process ID, TTY flags, environment, stdin/write/resize/attach, or interactive lifecycle controls. It does not create a host-side executor, mutateCODEX_CONFIG, enableunified_exec, or alter mounts or credentials.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 becauseCODEX_API_KEYandOPENAI_API_KEYare unavailable. Prior ChatGPT-authenticated App Server probes verified TTY stdin/stdout,stty, the trusted worktreepwd, and exit code 0. Bun-only release bundling was not run because Bun is unavailable; the normal production build passed.Breaking changes
None. This adds versioned underscore extension methods and does not change existing ACP command behavior.
Screenshots
N/A — no UI-visible changes.