Repository navigation
fix(cli): headless auto approval waits for Jev when jev_approval is on - #215
Conversation
qq run --approval auto set reviewer_configured only when reviewer_model was set, so a Jev-only configuration denied root held calls the moment they were published, before Jev could answer. The flag now also covers the run's resolved jev_approval, with the same precedence plan compilation uses (override, then the selected profile, then the top level). Refs: ENG-972
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24ba1103a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Review (Codex, #215): with a delegate configured but approval_delegate: off (configured, from the profile, or the resumed session's own override), the gate never consults it, yet headless auto waited the full 20 s reviewer grace before denying. The run now resolves approval_delegate with plan precedence (override, profile, top level), lets a resumed session's persisted override win as the gate does, and waits only when that setting consults a reviewer under the run's mode. Regression: a_delegate_that_is_configured_but_switched_off_does_not_delay_the_denial (configured off and session override off; fails with the check removed). Also merges #214 (via main) into this branch. Refs: ENG-972
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7b6316030
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8d45a0fd0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ests the real config path Review (Codex, #215): - The delegate chain publishes tool_approval_escalated the moment it gives up, but headless auto only logged it and waited the 20 s grace per call. Unattended runs (auto, and owned children) now answer the escalation with a denial immediately. Regression an_escalation_is_denied_at_once_not_after_the_reviewer_grace (times out without the change). - Child holds bypassed the effective-delegate check (|| !ours). Children copy the root session's approval_delegate override at spawn and run supervised, so they now wait only when that setting consults a reviewer under supervised. - The Jev headless test set reviewer_configured by hand, as A2 forbids. prepare_headless's delegate resolution is extracted to headless_delegate_options and the test calls it on a real Jev-only config loaded by the config loader; the fake Jev approves after 100 ms. Also merges #214 into this branch. Refs: ENG-972
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66be49457c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (ours && handle.wait_for_delegate) | ||
| || (!ours && handle.child_waits_for_delegate) => |
There was a problem hiding this comment.
Cover disabled delegation for supervised child calls
Fresh evidence after the prior child-call report is that the final patch fixes the !ours bypass through child_waits_for_delegate, but its new disabled-delegate test exercises only a fresh root and a resumed root; no test spawns a supervised child with approval_delegate: off. That leaves the exact child regression—waiting the 20-second grace despite having no consulted delegate—unguarded, so add a headless parent/child case that verifies immediate denial.
AGENTS.md reference: AGENTS.md:L146-L150
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Won't fix now: this is a test gap. The child path is fixed (child_waits_for_delegate uses the inherited setting under supervised), and a headless parent/child spawn fixture would be sizeable for one assertion. Noted for the Jev JV2 follow-up tests.
| cli::RunApproval::Full => headless::HeadlessApproval::Full, | ||
| }, | ||
| reviewer_configured: snapshot.reviewer_model().is_some(), | ||
| reviewer_configured, |
There was a problem hiding this comment.
Update the Jev-only headless runbook guidance
This wiring makes a Jev-only headless auto run wait for Jev, but docs/runbooks/jev.md:170-171 still lists immediate denial as a current limitation and tells operators to configure a reviewer_model. After this commit ships, that procedure is false and can cause users to configure an unnecessary additional inference route; update or remove the limitation in this change.
AGENTS.md reference: AGENTS.md:L207-L210
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed: removed the stale limitation and the reviewer_model advice from docs/runbooks/jev.md.
Review (Codex, #215): headless auto now waits for a Jev-only delegate, so the runbook's known-limitation entry and its advice to add a reviewer_model are no longer true. Refs: ENG-972
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…ns (#216) * fix(runtime): make the empty-truncation cap raise reachable in sessions A session run starts at the resolved cap, which was also the raise limit, so max_output_tokens >= ceiling always held: RR8.1's raise-once never fired and the error called the configured cap the "model ceiling". Compiled plans now carry a separate output ceiling (catalog limit, bounded by policy); the raise doubles toward it and the error names it. A turn that streamed a complete tool call and was then cut dropped the call and was resent unchanged up to three times; while the cap can still grow it now takes the same raise, otherwise it continues as before. Refs: ENG-973 * fix(runtime): record the raised cap per turn; ceiling edits replace the plan; honest empty-turn count Review (Codex, #216): - The raised retry cap was sent, but model_turns.model_json and model_turn_completed kept the claim-time cap. Each Prepared now updates the per-turn model record to the cap actually sent. Regression: a_raised_output_cap_is_what_the_retried_turn_records (fails without). - output_ceiling is outside the digest, so lowering only a managed policy.max_output_tokens revalidated the old plan. It joins the live bindings (RuntimeSwitches) beside jev_approval. The ceiling test now lowers the managed file and expects the new ceiling (fails without). - A call-then-cut turn consumed the raise and then counted as a reasoning-only turn in the terminal diagnostic. A separate count of genuinely empty turns drives the message. Regression: the_reasoning_diagnostic_counts_only_turns_that_produced_nothing. Also merges #215 into this branch. Refs: ENG-973
Stack ENG-968 (v0.1.5 readiness), 4 of 9. Merge in order; diff shown is this layer only.
Bug (Jev audit finding 4)
qq run --approval autosetreviewer_configuredonly forreviewer_model, so a Jev-only configuration denied root held calls the instant they were published, before Jev answered. The existing test forced the flag and hid this.Fix
approval_delegate_configuredcovers the run's resolvedjev_approvalwith plan-compile precedence (override → selected profile → top level).Tests
headless_auto_waits_for_jev_when_the_run_resolves_jev_approval_on(precedence table). Linear: ENG-972.Verification (top of stack)
cargo test --workspace1970 passed / 0 failed / 7 ignored;cargo clippy --workspace --all-targets --all-features -- -D warningsclean;cargo fmt --all -- --checkclean;cargo test -p qq-provider --no-default-features --features test-supportpassed.