Skip to content

fix(agent): defer background review during TUI turns - #60

Merged
OmarB97 merged 1 commit into
mainfrom
fix/background-review-idle-gate-fork
Jun 1, 2026
Merged

fix(agent): defer background review during TUI turns#60
OmarB97 merged 1 commit into
mainfrom
fix/background-review-idle-gate-fork

Conversation

@OmarB97

@OmarB97 OmarB97 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Why

Clean fork mirror for upstream PR NousResearch#36187. PR #59 was closed because it was based on upstream/main and conflicted with fork main; this replacement is based on fork main.

What changed

  • Tracks foreground turns with a generation counter.
  • Gives TUI sessions a 60s idle delay before background memory/skill review.
  • Skips the review if a new foreground turn starts during that idle window.
  • Leaves non-TUI behavior unchanged unless HERMES_BACKGROUND_REVIEW_IDLE_DELAY_SECONDS is configured.

Verification

  • python3 -m py_compile run_agent.py agent/agent_init.py agent/conversation_loop.py agent/background_review.py tests/run_agent/test_background_review.py
  • python3 -m pytest -o addopts='' tests/run_agent/test_background_review.py tests/run_agent/test_background_review_cache_parity.py tests/run_agent/test_background_review_toolset_restriction.py tests/run_agent/test_codex_app_server_integration.py::TestRunConversationCodexPath::test_background_review_skill_trigger_fires_above_threshold tests/run_agent/test_codex_app_server_integration.py::TestRunConversationCodexPath::test_background_review_signature_never_breaks -q
  • git diff --check

Upstream

NousResearch#36187

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

🔎 Lint report: fix/background-review-idle-gate-fork vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9631 on HEAD, 9626 on base (🆕 +5)

🆕 New issues (3):

Rule Count
unresolved-attribute 3
First entries
tests/run_agent/test_background_review.py:146: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_background_review_idle_delay_seconds` on type `AIAgent`
tests/run_agent/test_background_review.py:109: [unresolved-attribute] unresolved-attribute: Object of type `AIAgent` has no attribute `_foreground_turn_generation`
tests/run_agent/test_background_review.py:145: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_foreground_turn_generation` on type `AIAgent`

✅ Fixed issues: none

Unchanged: 5000 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@OmarB97

OmarB97 commented Jun 1, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR: NousResearch#36187

This fork mirror replaces superseded PR #59, which conflicted because it was based from upstream/main instead of fork main. Live taro Hermes has also been patched and hermes-phone restarted so this can be exercised immediately.

@OmarB97
OmarB97 merged commit 83065d4 into main Jun 1, 2026
23 checks passed
@OmarB97
OmarB97 deleted the fix/background-review-idle-gate-fork branch June 1, 2026 02:28
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