Skip to content

fix(cli): admit stdio approval transports for prompt turns - #1069

Merged
XuPeng-SH merged 3 commits into
mainfrom
fix/stdio-prompt-admission
Oct 18, 2026
Merged

XuPeng-SH merged 3 commits into
mainfrom
fix/stdio-prompt-admission

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1041.

One-shot Prompt and AcceptEdits turns can now use the existing approval request channel when a stdio approval sink is present. Previously admission rejected these turns despite the transport being able to carry approvals. A missing approval sink still fails before chat admission. Question-tool availability is negotiated separately, and the canonical restricted-tool policy prevents Server from reinserting an unavailable question tool.

Validation: the public-process no-sink case passed in the managed environment. The same public-process test binary passed the full stdio case on the formal host: allow writes the expected file, deny performs no write and reports the failed callback, interrupt cancels the exact run, and stale approval IDs are rejected. The managed full case failed at its existing unsupported-host guard; that guard was preserved. Formatting and diff checks pass. CLI library admission tests, the runtime builder restriction test, current-head CI, and integrated regression remain pending. No provider calls were used for these transport tests.

Source head: 1e923c4, based on main ee07dcf. Local public-process execution preceded this rebase; all six touched files are byte-identical after it. Independent static review found no remaining blocking issue. This is not a current-head formal approval.

Current head: a7a2745b66fd11b9a9da75eb4baf5d6c46474c7b. The preceding head's shared CLI inventory ran 4,878 tests: 4,877 passed and one background-completion fixture failed at the new approval-capability guard. That fixture constructed a default Prompt session without the channels installed by the real TUI. This test-only follow-up supplies the real TUI's Silent output and live canonical approval/question channels; it neither auto-approves nor changes permission mode. All background-context assertions remain, with added checks that both actual chat requests use interaction_mode=prompt and neither channel receives an unexpected request. Production checks remain intact. Independent static follow-up review passed; precise local execution and new-head CI are pending. No manual CI rerun or new PR was requested.

@XuPeng-SH
XuPeng-SH marked this pull request as ready for review October 18, 2026 13:09

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Recommendation: APPROVE the code change at exact head a7a2745b66fd11b9a9da75eb4baf5d6c46474c7b. This independent AI review is submitted as COMMENT because the connected account is the PR author; it is not an approval vote or merge authorization. I found no blocking code findings.

I reviewed all seven changed files and the canonical stdio, admission, permission, cancellation and Server tool-surface call chains. Prompt/AcceptEdits can now advertise pause capability through the existing approval channel independently of TTY rendering and ask_user availability. Actual authorization still passes through the existing permission engine; no auto-approval or hard-denial relaxation was added. Missing approval capability fails before model admission. The stdio RPC path keeps approval IDs single-use, rejects settled/interrupted IDs, and denies pending responses on interruption or delivery failure.

Question capability remains separate: absence of its channel adds the canonical ask_user restriction, publishes the same deny set through the existing edge-profile key, and prevents Server-owned schemas from restoring that unavailable tool. I checked the builder's visible/deferred/valid/always-load surfaces and the local final-payload policy. The a7 follow-up changes only a test fixture: it matches the real TUI's Silent renderer and live canonical channels, retains Prompt mode and every previous background-context assertion, and adds two actual HTTP interaction_mode=prompt checks plus empty-channel assertions. It does not answer approvals automatically. Current main f0dd007ba6f239936bb399a8bcc73c7c830eb835 was also inspected: its native-CA change has no overlapping changed files; execution of the combined binary remains a separate check.

Current-head evidence: shared CLI passed 4,878/4,878 tests with 20 skips, including the interaction-policy and background fixture cases; runtime passed 5,977/5,977 with 192 skips, including the real builder restriction case. Lint actually ran Clippy, formatting and RustSec audit successfully. Fresh full pagination returned 40 check runs and an empty second page; all 15 exact required contexts from GitHub Actions App 15368 succeeded. The macOS aggregate actually checked successful coordination and terminal dependencies. Both scope classifiers fell back to full scope after git diff failed; Web/SDK therefore ran successfully, rather than being scope-skipped. The latest title check succeeded; its earlier cancelled run is superseded.

The optional harness job failed after completing all 18 cases: 17 passed, and introspection_reflection_source_boundary reported InfraVerificationUnavailable with exit code 0. Its safe analysis says the LLM judge evaluation was unavailable, not a negative quality verdict. A deeper root cause or relationship to this patch is not established; I do not claim every check or the complete merge gate passed.

Limits: the public-process approval/deny/interrupt/stale-ID evidence comes from the historical same-source r2 test binary on the formal host; the no-sink case passed in the managed environment. Those two cases were not observed in the current-head shared CI log and are not represented here as current-head CI execution. This review ran no new Cargo tests, provider requests or CI reruns. Final integrated real acceptance with the final fixed binary and combined latest main remains pending; no newly building process-group test is claimed as passed. This recommendation does not replace code-owner review or repository merge policy.

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.

[Bug]: serve stdio Prompt mode rejects tool approval instead of using its approval RPC channel

1 participant