Repository navigation
fix(companion): never store a raw session ID as the agent name - #1468
Conversation
Herdr subagents report busy without an agent field. onSessionStatus stored the session ID as the agent name, which the companion cannot render. Fall back to 'orchestrator' instead, the same generic busy name activeAgents() uses, so these sessions still show as busy. Fixes alvinunreal#1467
|
| // ses_x is now tracked because Herdr subagents often lack | ||
| // the agent field; the session ID is used as a fallback name. | ||
| expect(readState().sessions[0].active_agents).toEqual(['ses_x']); | ||
| expect(readState().sessions[0].active_agents).toEqual(['orchestrator']); |
There was a problem hiding this comment.
Test comment describes old fallback. The comment above this assertion says the session ID is used as the fallback name, but the test now expects
orchestrator. This makes the test misleading for anyone checking how unnamed agents are displayed.
| // ses_x is now tracked because Herdr subagents often lack | |
| // the agent field; the session ID is used as a fallback name. | |
| expect(readState().sessions[0].active_agents).toEqual(['ses_x']); | |
| expect(readState().sessions[0].active_agents).toEqual(['orchestrator']); | |
| // ses_x is now tracked because Herdr subagents often lack | |
| // the agent field; orchestrator is used as the fallback name. | |
| expect(readState().sessions[0].active_agents).toEqual(['orchestrator']); |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Fixes #1467.
When a
session.statusbusy event arrived without an agent name,CompanionManager.onSessionStatusstored the raw session ID as the agent name. That ID then showed up inactive_agentsin the companion state, and the companion binary found no animation for it and drew the fallback image. It now falls back toorchestrator, the generic busy name, and the test covers the no-agent case.Ran the companion manager tests on the committed HEAD: 60 passed, 0 failed (3 of the previous 57-pass run's tests failed before the change).