Repository navigation
fix(shell): restore the #891 agentStateService clobbered by #935 — pod pages crash - #936
Merged
Merged
Conversation
…obbered — every pod page crashed P0, caught live in post-deploy browser verification. #935's activity derivation was written as a NEW file at backend/services/agentStateService.ts — a path where the #891 mention-honesty service already lived. Its same-named test sat at the same test path, so the clobber also buried the suite that would have caught it, and CI stayed green. Live effect: the /:podId/agent-states route called MY deriveAgentState(lastActiveAt, runtimeType) with (installation, tokens, callerId), returned bare 'stale' strings, and the typeahead useMemo crashed the ENTIRE pod page on s.agentName.toLowerCase(). - restore agentStateService.ts + its test verbatim from #910 - re-add the activity pieces in the SAME file under non-colliding names: collectPodAgentActivity + deriveActivityBucket (tool + roster call sites updated); activity tests live in agentStateService.activity.test.js - V2PodChat: the honesty surface promises 'silence over a wrong dot' — that now includes malformed payloads; shape-guard the map so a bad backend degrades to no-dots, never an error boundary Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
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.
P0 — live crash, my defect, caught in my own post-deploy browser verification
#935's activity derivation was written as a new file at
backend/services/agentStateService.ts— a path where the #891 mention-honesty service already lived. Its test was written at the exact path of the #891 suite, so the clobber also buried the test that would have caught it, and CI stayed green — two overwrites, each hiding the other.Live effect:
GET /:podId/agent-statescalled myderiveAgentState(lastActiveAt, runtimeType)with(installation, tokens, callerId)→new Date(installation)→ NaN → every agent'stale'as a bare string → the composer typeahead'ss.agentName.toLowerCase()throws → the entire pod page error-boundaries for every user.Fix
agentStateService.ts+ its test restored verbatim from feat(shell): mention-time honesty — #891 surface 1 #910; the activity pieces re-added in the same file under non-colliding names (collectPodAgentActivity,deriveActivityBucket) with call sites updated; activity tests in their own file.V2PodChat: the honesty surface's own contract is "silence over a wrong dot" — that now covers malformed payloads too; shape-guard so a bad backend degrades to no-dots, never an error boundary.Proof
All 8 restored #891 honesty cases + 5 activity cases + the #915 roster regression suite pass; both typechecks clean.
Lesson (also inlined at the collision site): never add a "new" service without reading the path first; never name two exports the same because they feel similar.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8