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

fix(supervisor): dispatched jobs inherit the wrong timeout (300s, not works own 1800s)#395
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
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