Repository navigation
test: catch reverts of the scheduler lease, restart notice and tool limit - #5456
Conversation
…imit Three fixes on main could be undone with every test still green. A scheduler recovery could take over a job that a second driver is firing right now if the two claims carry the same timestamp. A scheduled email would then be marked failed mid-send, or a recurring job queued to run twice. The bridge's notice after replacing a wedged agent could go back to telling the user to send "continue" to an agent that has forgotten the question. And nothing showed that a hung tool under Slack or Telegram ends at all: the bridge never stops a turn while a tool runs, so only the agent's own tool limit can end it. Each new test fails when its fix is reverted: - Scheduler, both stores: dropping the claim_id half of the recovery guard leaves the live claim 'failed' or 'pending' instead of 'firing'. - Bridge restart: a notice that says "Send continue" without quotes, and no longer says the conversation was lost, passed every existing test. - Hung tool: the real gaia-agent turn loop behind a real AgentChannel. With no tool limit the user never gets an answer; with a bridge that ignores a running tool the turn is stopped instead of answered. The hung-tool test needs the flagship wheel, so it runs in the gaia-agent lane and is allowlisted as a module skip in the unit lane.
|
Verdict: Approve This PR adds tests only. They pin three fixes already on main: the scheduler lease guard, which stops a scheduled job from being failed or re-queued while it is still running; the "resend, don't continue" notice after an agent restart; and a hung tool under Slack/Telegram still ending with an answer. I found no blocking issues. The test setups fit the code they exercise, and the new bridge test is wired into the CI lane that has the flagship package, so it won't be skipped. Real-world evidenceN/A: this PR changes only tests and CI wiring, with no user-facing surface. I couldn't run the tests in this review environment because pytest isn't installed, so the verdict rests on static review plus the revert table in the PR description. 🔍 Technical detailsIssues found 🟢 Possible flake under a slow runner ( Checked
Strengths
|
A stall over the 3 s tool limit between the tool call and the first assert would fail the test for the wrong reason.
|
Took the flake note: the hung-tool test's tool limit is now 6 s instead of 3 s, so a runner stall between the tool call and the first check can't end the tool early. It costs about 3 s of test time. |
Three fixes on main could be reverted with every test still passing. That covers a scheduled email marked failed while it is still sending (#5380), the Slack/Telegram notice after an agent restart telling users to "continue" a conversation the agent forgot (#5382), and nothing proving a hung tool under the messaging bridge ever ends. Each new test fails on the user-visible symptom when its fix is undone.
claim_id. Without that half of the recovery guard, a stale read fails a live send or re-queues a running job."continue". An unquoted "Send continue" that also dropped "no longer remembers this conversation" passed everything.GAIA_AGENT_TOOL_TIMEOUT, 180 s) ends it. This drives the realgaia-agentturn loop behind a realAgentChanneland checks the user still gets an answer. It needs the flagship wheel, so it runs in the gaia-agent lane.🔍 Technical details
Reverts run locally, each against the new test:
claim_id = :claimfromrecover_claim(daemon + email store)failed/pending!=firingrestarted. Send continue to pick up where it left off.... Send "continue" to pick up where it left off._call_tool_boundedtimeout →inftool_calltool_runningerror!=finalThe email schedule tests skip from the repo root unless
gaia_agent_emailis installed, because the root conftest only redirects hub packages that are already installed. CI does run them:test_email_agent_unit.ymlinstalls the wheel and gates wholesale skips. Main push run 39538913521 shows all 13 stale-firing tests and 16test_email_schedule.pytests PASSED.Test plan
python -m pytest tests/unit/test_daemon_scheduler_stale_firing.py tests/unit/messaging/ -q: passes locally and in Unit Tests run 39541345649. That run executed the new daemon and restart tests and skippedtest_bridge_hung_tool.pyas allowlisted.python -m pytest hub/agents/email/python/tests/test_email_schedule_stale_firing.py -qwithgaia_agent_emailinstalled: passes locally, and both new cases (scheduled_send,snooze) passed in Email Agent Unit Tests run 39541345667.python util/check_test_lane_coverage.pypasses (run locally).test_bridge_hung_tool.pyand it passed (not skipped).