fix(kanban): isolate background-review lifecycle - #78258
Open
silverdale-admin wants to merge 1 commit into
Open
Conversation
Author
|
Verification on pushed commit
The earlier full-repository run was stopped during an operator-requested WebUI restart. Its observed failures were in unrelated optional/integration suites (for example Hindsight/Modal dependencies); this PR does not claim a clean full-suite result. |
Author
|
Full-suite follow-up on macOS:
Conclusion: the complete local suite is not green on this macOS environment, but the observed failures are baseline/environmental and not regressions introduced by this patch. |
adurham
pushed a commit
to adurham/hermes-agent
that referenced
this pull request
Aug 8, 2026
…sResearch#82070) Confirmed the same session_id-sharing race that this fork fixed on 2026-07-22 (doubled prompt-token accounting + Ctrl+C-proof lockup) still reproduces on upstream/main. Filed as PR NousResearch#82070; not a duplicate of the one other open PR touching this file (NousResearch#78258, a different Kanban task-failure bug).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
A background review fork runs in-process and inherits
HERMES_KANBAN_TASKfrom a dispatcher-spawned worker. The fork has its own hardcoded 16-iteration budget. If it exhausts that budget,turn_finalizer.pysees the inherited task id and records a second task failure against the parent card.In production this appears as a real worker timeout followed seconds later by a synthetic auxiliary failure, for example:
The review fork does not own the task claim or run and must not advance the parent card's failure circuit.
Fix
Add an agent-local Kanban lifecycle ownership flag. Background review forks set the opt-out before
run_conversation(). The turn finalizer consults it before resolvingHERMES_KANBAN_TASKand recording a budget-exhaustion failure.This uses agent-local state rather than mutating
os.environ, which would be unsafe because the review runs in a thread inside the parent worker process.Test plan
scripts/run_tests.sh tests/agent/test_turn_finalizer_iteration_limit_exit.py tests/agent/test_turn_finalizer_interrupt_alternation.py tests/agent/test_turn_finalizer_final_response_persistence.py tests/agent/test_turn_finalizer_cleanup_guard.py tests/test_background_review_session_isolation.py tests/test_background_review_list_shapes.py tests/run_agent/test_background_review.py tests/run_agent/test_background_review_toolset_restriction.py tests/run_agent/test_background_review_summary.py tests/run_agent/test_background_review_cost_controls.py tests/run_agent/test_background_review_cache_parity.py -qscripts/run_tests.sh -qRelated: #71175. This fixes the auxiliary
16/16false-failure component; it is complementary to #71189's goal-mode claim-retention work.