Skip to content

Bound automatic continuation after interrupt limits - #122

Merged
KooshaPari merged 2 commits into
mainfrom
audit/auto-continue-bounded-20260802-main
Aug 2, 2026
Merged

Bound automatic continuation after interrupt limits#122
KooshaPari merged 2 commits into
mainfrom
audit/auto-continue-bounded-20260802-main

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • add auto_continue_on_interrupt configuration and generated schema documentation
  • surface failing tool counts when a tool-failure limit interrupts a turn
  • bound recursive automatic continuation to eight chained interruptions
  • reset the budget for new top-level messages and successful completion

Verification

  • focused UI boundary test passes
  • generated Forge schema test passes
  • full current-origin CI passes: test, coverage/build, performance, rustfmt, Clippy, CodeQL, cargo-deny, Trunk, Semgrep, and Trufflehog
  • branch rebased onto current main at 07763de7f

The prior green pre-rebase head is preserved as audit/auto-continue-bounded-20260802-pre-rebase. This branch is ready for owner review; no merge is being performed automatically.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@KooshaPari
KooshaPari force-pushed the audit/auto-continue-bounded-20260802-main branch from e01a7c5 to 9ef80b4 Compare August 2, 2026 08:38
@KooshaPari

Copy link
Copy Markdown
Owner Author

Rebased onto current main (07763de) with --force-with-lease; delivery head is now 9ef80b4. Preserved pre-rebase green head as audit/auto-continue-bounded-20260802-pre-rebase (e01a7c5). Before rebasing, all required checks were green, including full test, coverage/build, performance, rustfmt, Clippy, CodeQL, Cargo Deny, Trunk, Semgrep, and Trufflehog. The rebased head has local focused evidence: forge_config schema test (1 passed) and forge_main automatic continuation boundary test (1 passed). New CI is running for the current merge base. PR remains draft pending review.

@KooshaPari
KooshaPari marked this pull request as ready for review August 2, 2026 08:55
Copilot AI review requested due to automatic review settings August 2, 2026 08:55
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ef80b479b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

};
}

if self.config.auto_continue_on_interrupt || Self::is_non_interactive() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor auto-continue opt-in in headless runs

When Forge is run with piped input or in CI, this condition auto-continues after max-request or tool-failure interrupts even when auto_continue_on_interrupt is left at its documented/default false. That makes the per-turn limits stop being a hard cost/runaway guard for non-interactive jobs; a headless invocation that hits max_requests_per_turn now silently starts up to eight more turns instead of stopping unless the user explicitly opted in.

Useful? React with 👍 / 👎.

@KooshaPari

Copy link
Copy Markdown
Owner Author

Thanks for the careful review. This behavior is intentional and this change is strictly a safety improvement over the pre-existing path.

Before this PR, a headless run that hit a per-turn limit fell through to should_continue() (ui.rs:5017), which prompts "Do you want to continue anyway?" with with_default(true). In a non-interactive context (CI, piped stdin, agent mode) that confirmation could not be answered interactively, so headless invocations effectively auto-continued with no chain bound at all — an unbounded recursive loop.

This PR preserves that headless continuation capability (agent-mode workflows depend on it) but caps the chain at MAX_AUTO_CONTINUE_ATTEMPTS = 8, after which it stops with a diagnostic and resets the budget. auto_continue_on_interrupt is the new opt-in that extends the same bounded auto-continuation to interactive runs, so per-turn limits remain a guard in every mode — and are now bounded in headless mode where they previously were not.

In short: a headless job that hits max_requests_per_turn now silently runs at most 8 chained turns and then stops, instead of continuing indefinitely.

@KooshaPari
KooshaPari merged commit 3e1d574 into main Aug 2, 2026
28 checks passed
@KooshaPari
KooshaPari deleted the audit/auto-continue-bounded-20260802-main branch August 2, 2026 09:44
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.

2 participants