Skip to content

test(cli): give the exit-code stub agent the session-reset hook - #4675

Merged
kovtcharov-amd merged 1 commit into
amd:mainfrom
kovtcharov:kalin/fix-chat-stub-agent
Oct 4, 2026
Merged

kovtcharov-amd merged 1 commit into
amd:mainfrom
kovtcharov:kalin/fix-chat-stub-agent

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

Main's unit test lanes are red: test_chat_query_success_exits_zero_without_printing_status fails on Linux, macOS and Windows. #4520 made gaia chat call agent._ensure_tool_loader_reset() directly (no fallback), and #4612 added this test with a stub agent that lacks the method. Each passed on its own; main broke when both landed. The stub now has the method, as the other chat-path stubs already do.

Test plan

  • pytest tests/unit/cli/test_cli_exit_codes.py passes
  • Unit Tests green on main after merge

Main's unit lanes fail on test_chat_query_success_exits_zero_without_printing_status. amd#4520 made gaia chat call agent._ensure_tool_loader_reset() with no hasattr fallback, and amd#4612 added this test with a stub agent that lacks the method, so each passed alone and main broke once both landed.
@github-actions github-actions Bot added the tests Test changes label Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Verdict: Approve

This fixes main's red unit-test lanes. Two PRs that each passed on their own collided once both merged: gaia chat now always calls a session-reset hook, and a newer exit-code test used a fake agent that didn't have that hook. The fix gives the fake agent the hook. It matches the other chat test stubs exactly and changes no product code.

Real-world evidence

N/A: this PR only changes tests. The verdict rests on static review. I couldn't run pytest in this review environment because the module isn't installed, so the post-merge Unit Tests check in the PR's test plan is the real confirmation.

🔍 Technical details

Issues found: none.

Strengths

  • The stub's no-op _ensure_tool_loader_reset matches the existing pattern in tests/unit/cli/test_chat_one_shot_output.py:24 and tests/unit/test_no_learned_skills_flag.py:32. Every chat-path stub now meets the same contract.
  • It fixes the test rather than adding a hasattr fallback in src/gaia/cli.py:723. That keeps the call fail-loud, as CLAUDE.md requires.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 4, 2026
Merged via the queue into amd:main with commit 279bf63 Oct 4, 2026
@kovtcharov-amd
kovtcharov-amd deleted the kalin/fix-chat-stub-agent branch October 4, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants