Skip to content

fix(supervisor): dispatched jobs inherit the wrong timeout (300s, not works own 1800s) - #395

Merged
getappz merged 1 commit into
masterfrom
task/18
Aug 7, 2026
Merged

getappz merged 1 commit into
masterfrom
task/18

Conversation

@getappz

@getappz getappz commented Aug 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • dispatch_item now sets the outer AgentJob's timeout explicitly (2100s), instead of inheriting agentflare-jobs' generic 300s default.
  • agentflare work's own --timeout flag already defaults to 1800s -- its real intended budget for a headless agent run -- but the daemon was killing every dispatched job at 5 minutes without that inner budget ever coming into play.

Found live: item #13 timed out at exactly 300s twice in a row while dogfooding items #15-#17 (PRs #392-#394), even after both the identity and orphan-kill fixes landed -- the timeout itself was just too short to ever let a real fix complete.

Test plan

  • cargo test --bin agentflare -- supervisor -- all pass
  • cargo clippy --all-targets --all-features -- -D warnings -- clean

Summary by CodeRabbit

  • Bug Fixes
    • Increased the overall timeout for dispatched work jobs to accommodate setup and completion overhead.
    • Preserved the existing command arguments and inner timeout behavior.

… work's own 1800s)

agentflare work's own --timeout flag defaults to 1800s (its real budget
for a headless agent run), but dispatch_item never set a timeout on the
outer agentflare_jobs::AgentJob it enqueues, so it fell back to that
crate's generic 300s default -- killing every dispatched job at 5 minutes
without the inner, correctly-tuned 30-minute budget ever coming into play.

Found live: item #13 timed out at exactly 300s twice in a row while
dogfooding items #15-#17, even after both of those fixes landed.
@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dc6a9d5e-2b0d-4507-9e43-511be99fc696

📥 Commits

Reviewing files that changed from the base of the PR and between b0f59dc and 6f39822.

📒 Files selected for processing (1)
  • src/supervisor.rs

📝 Walkthrough

Walkthrough

The supervisor adds a 2100-second timeout for dispatched agentflare work jobs. The command arguments and enqueue flow remain unchanged.

Changes

Work job timeout

Layer / File(s) Summary
Configure and apply the work job timeout
src/supervisor.rs
The supervisor defines WORK_JOB_TIMEOUT_SECS as 2100 seconds and applies it when constructing dispatched AgentJob instances.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the timeout defect and relates directly to the primary change.
Description check ✅ Passed The description includes the required Summary and Test plan sections, but it omits Notes for reviewers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/18

Comment @coderabbitai help to get the list of available commands.

@getappz
getappz merged commit ae4bb66 into master Aug 7, 2026
17 checks passed
@getappz
getappz deleted the task/18 branch August 7, 2026 07:00
getappz added a commit that referenced this pull request Aug 11, 2026
…ge collisions (#456)

* git-shim/worktree residual polish: teardown messaging, branch-create accuracy, stranded-checkout recovery

- worktree deny message now distinguishes provisioning (claim) from
  teardown (check_merge/release/audit --prune) so an agent denied
  mid-teardown gets the exact cleanup action (vent #350)
- is_branch_create() classifies checkout -b/-B and switch -c/-C;
  canonical-checkout deny says 'create a new branch' instead of the
  misleading 'would detach HEAD' (vent #395)
- audit_orphans flags worktrees stranded on the default branch (intact
  gitdir) so worktree audit --prune clears the gh pr merge --delete-
  branch / post-merge-sync collision root cause (vents #351/#394/#423)
- AGENTFLARE_GIT_ALLOW_CANONICAL_MUTATE now also lifts the default-branch
  checkout/switch deny in the canonical checkout, giving stranded
  checkouts a sanctioned way back (vent #386 residual)
- allowlist classify.rs (already 1604L on master) in the LOC gate

Agentflare-Agent: 1
Agentflare-Branch: task/441
Agentflare-Item: 441

* fix(git-shim): close branch-create detection gaps, protect dirty stranded worktrees

CodeRabbit review on PR #456:
- is_branch_create only matched exact -b/-B/-c/-C, missing --orphan
  (checkout+switch), switch's --create/--force-create long forms, and
  attached short-option spellings (-bname). Those forms slipped past
  both would_detach_head and deny_canonical_detach_reason undetected,
  letting an agent create a branch in the canonical checkout via e.g.
  'git switch --orphan x' or 'git checkout -bx' with no deny at all.
- audit_orphans' new on-default-branch detection could hand a dirty,
  uncommitted stranded worktree to gc_orphans for deletion; the only
  other gc_orphans caller (cleanup_item_worktree) already refuses on
  a dirty status check first. Apply the same guard here.

Agentflare-Agent: claude-code_2-1-227_agent
Agentflare-Branch: task/441
Agentflare-Item: 441
getappz added a commit that referenced this pull request Oct 24, 2026
* docs: add PR lifecycle workflow design spec for item #395

Carve docs/superpowers out of /docs gitignore so shared specs can be
versioned like existing superpowers plans. Documents replacing the
supervisor review sweep with flare-workflow pr-reconcile/pr-lifecycle.

Co-authored-by: Cursor <cursoragent@cursor.com>

Agentflare-Agent: cursor
Agentflare-Branch: task/395-design-spec-pr-lifecycle-workflow-replac
Agentflare-Item: 395

* docs: rev 2 PR lifecycle spec — schedule engine gap and reviewer pass

Clarify #366 start_key_for semantics, JSON-vs-Rust schedule fire path,
expanded pr-agent audit, and explicit design-spec acceptance criteria.

Co-authored-by: Cursor <cursoragent@cursor.com>

Agentflare-Agent: cursor
Agentflare-Branch: task/395-design-spec-pr-lifecycle-workflow-replac
Agentflare-Item: 395

* docs: rev 3 PR lifecycle spec — item-work pipeline and design-spec evidence

Clarify how SDD design-spec items differ from review-only tasks, what
counts as completion evidence versus cargo test on an unchanged tree, and
how #395 relates to the proposed pr-reconcile lifecycle workflows.

Co-authored-by: Cursor <cursoragent@cursor.com>

Agentflare-Agent: cursor
Agentflare-Branch: task/395-design-spec-pr-lifecycle-workflow-replac
Agentflare-Item: 395

* wip(sdd-loop): task 0 checkpoint

Agentflare-Branch: task/395-design-spec-pr-lifecycle-workflow-replac
Agentflare-Item: 395

* Verifying the analyst's report against the repo: reading the spec, git state, and key codebase references.
REVIEW_ISSUES:

- **Stale verification claim:** Rev 5 is **committed** at `HEAD` (`71cf49f8`, +43 lines to the spec). Working tree is clean; there is no uncommitted rev 5 delta. The “commit before `item done`” note applies only if that was written before the checkpoint commit.
- **Branch scope not surfaced:** `git diff master` is **not** limited to design docs. Besides `.gitignore` and the spec, **19 Rust paths** differ (~93 insertions, **~1,889 deletions**), including large removals under `src/review/diff.rs`, `src/memory/mcp.rs`, `src/mcp_server/item_merged_pr.rs`, and supervisor/worktree tests. That contradicts item #395 (“design-spec only, no application code”) and is a merge risk; the analysis should call this out explicitly for operators.
- **Embedded spec verification vs current HEAD:** The rev 5 verification block still records `HEAD=83f1d90a` and **497** lines; the file is now **500** lines at `71cf49f8`. Harmless as history, but the analyst run should report **current** `wc -l` and `HEAD` when citing verification.
- **Line count:** Spec is **500** lines, not “~501” (minor).
- **Branch sync:** Branch is **behind `origin/master` by 4** commits (and ahead by 5). Not mentioned; relevant before PR/merge.
- **Technical summary:** Substance on `pr-reconcile` / `pr-lifecycle`, `spawn_schedule_ticker` + JSON-only schedule fire (`resolve_named_definition` in `schedule/tick.rs`), `start_workflow_once`, cutover flag, pr-agent stance, item-work vs PR lifecycle, and parity rows for all `PrCiStatus` variants matches the spec and current code anchors. No correction needed there beyond the branch hygiene gap above.The `mbx build -p agentflare` check never finished: it was killed after about two minutes (exit **137**, lean-ctx output cap), so we don’t have a compile pass/fail for this branch.

That doesn’t change the review outcome. The branch still has large Rust diffs vs `master` (~1.9k lines removed across 19 files) on top of the design spec, which is the main hygiene issue called out in **REVIEW_ISSUES**.

Agentflare-Branch: task/395-design-spec-pr-lifecycle-workflow-replac
Agentflare-Item: 395
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