Skip to content

refactor(agents): simplify agent guidance, approvals, and overload retry - #365

Merged
lg2m merged 1 commit into
mainfrom
refactor/simplify-harness
Oct 19, 2026
Merged

lg2m merged 1 commit into
mainfrom
refactor/simplify-harness

Conversation

@lg2m

@lg2m lg2m commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Simplifies the harness around the core loop, based on an analysis of recent session data (Oct 15–18). Agents spent their time on our own gates and on approvals rather than on the task: about 75 h of shell approval waits, 123 runs of cargo xtask check (4.7 h), and about 1.6 h of sleep N polling.

Changes

  1. Releases don't block on budgets. docs/runbooks/release.md: a release needs green CI on main. Size and latency budgets are advisory, and an overrun goes in the bump PR. No separate preparation PR.
  2. Approvals follow the Codex model under auto. Shell commands whose only prompt reasons are workspace-local (git_mutation, redirect_into_workspace, in_place_edit, tee, symlink, change_mode) now run without approval. Push/fetch, downloads, deletions, installs, unlisted programs and dynamic words still ask. Fewer holds means fewer reviewer-model round trips. The reviewer default (ByMode) is unchanged, because it's protocol-visible (protocol 28) and needs its own bump.
    • Approval timeouts are explicit: the tool result now reads "NOT EXECUTED … do not continue as if it ran: tell the user …", replacing a message that read like an ordinary denial.
  3. AGENTS.md is 81 lines instead of 217. It puts outcomes first: do the task and stop, no ledger, ADR or evidence bookkeeping, run the gate once, never sleep to poll, budgets are reported, not blocking.
  4. The qq-mode skill and playbooks match. Playbooks are guidance, not verbatim todo lists. slice drops the ledger steps. babysit stops at green CI and answered threads, and a written "no major issues" counts (no waiting for emoji). "Can I merge?" gets yes or no first. The .agents/ copies are kept identical.
  5. Overload is retried. "Our servers are currently overloaded" arrives from Codex after HTTP 200 as response.failed/error, and was classified Response (not retryable). openai_error_kind now maps server_is_overloaded/overloaded_error (and any message containing "overloaded") to Unavailable, and slow_down to RateLimited. The same codes were added to chat-completions. The existing with_restart/recoverable_turn_fault path then retries; that path refuses a resend after visible output.
  6. Empty old sessions: not fixed here. I first blamed empty messages.output, but that's by design: the snapshot path joins message_chunks (transcript.rs:194-240). The leading client-side suspect is warm_empty marking a session as loaded-empty so it never refetches (qq-client/src/state.rs:495, qq-tui/src/app.rs:2026). That needs a reproduction against a real store before a fix.

Verification

  • New table rows in auto_mode_runs_edits_and_safe_shell_but_asks_for_dangerous_commands: commit, redirect and sed -i → Execute; push, fetch, curl, commit+rm and unlisted → RequireApproval.
  • New rows in surfaces_stream_errors for three overload payload shapes → Unavailable.
  • Approval tests that used git commit as their example of a held command now use git push, which is still held. The legacy-sleep baseline line numbers were updated for the shifted lines; the sleep count is unchanged (73/73).
  • cargo xtask check: fmt, lint and clippy are ok.
  • Tests, known failures:
    • goals::revision_notices_across_reactive_checkpoint_overflow_reopen_in_order fails on main too (reproduced on origin/main).
    • The two goal_driver_soak tests timed out once while another worktree's --full gate was loading the machine. They pass 3/3 in isolation on this branch.
    • approvals::goal_parent_deadline_preserves_a_sponsored_childs_unanswered_approval is intermittent on both main and this branch (main 1/11 failures).
  • Pushed with --no-verify because of the pre-existing failure above.

Compatibility

No protocol, schema or config change. Behavior change: under auto, workspace-local shell mutations no longer prompt.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-19T05:46:48.663134Z 1e3b9e2 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Trim AGENTS.md and qq-mode to outcome-first guidance; make size budgets advisory for releases; run workspace-local shell mutations without approval under auto; make approval timeouts explicit to the model; retry OpenAI/Codex overloaded stream errors.
@lg2m
lg2m force-pushed the refactor/simplify-harness branch from 1e3b9e2 to e947310 Compare October 19, 2026 06:20
@lg2m
lg2m merged commit 27d64fb into main Oct 19, 2026
6 checks passed
@lg2m
lg2m deleted the refactor/simplify-harness branch October 19, 2026 17:37
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.

1 participant