Skip to content

fix(shell): restore the #891 agentStateService clobbered by #935 — pod pages crash - #936

Merged
lilyshen0722 merged 1 commit into
mainfrom
fix/agent-state-service-clobber-v2
Aug 13, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
fix/agent-state-service-clobber-v2

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

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-states called my deriveAgentState(lastActiveAt, runtimeType) with (installation, tokens, callerId) → new Date(installation) → NaN → every agent 'stale' as a bare string → the composer typeahead's s.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

…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
@lilyshen0722
lilyshen0722 merged commit 3b02a95 into main Aug 13, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the fix/agent-state-service-clobber-v2 branch August 13, 2026 10:43
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