Skip to content

fix: no "after restart" badge until the new pod has listed its tools (CLEAN-109) - #108

Merged
maksymhryzodub-prog merged 3 commits into
mainfrom
fix/CLEAN-109-tools-listing-state
Sep 23, 2026
Merged

maksymhryzodub-prog merged 3 commits into
mainfrom
fix/CLEAN-109-tools-listing-state

Conversation

@maksymhryzodub-prog

@maksymhryzodub-prog maksymhryzodub-prog commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #101. After restarting an agent, the Tools panel kept saying "after restart" until the page was reloaded.

Ticket: CLEAN-109

The client state was fine; the claim itself was wrong. Right after a restart the new pod is up but has not called tools/list yet, and the catalogue compared today's tools against the previous pod's snapshot, so every tool read as "missing from this pod".

  • API: GET /agents/:id/tools gains listingState (none / pending / fresh). A snapshot older than the running pod (10 s clock slack) is pending: no per-tool inPod flags, no badge. Flags are only set when the snapshot comes from this pod.
  • Admin: the sheet loads through the store on every open (no useAsyncData cache in between), shows a quiet "the agent has started and is loading its tools" note while pending, and polls every 4 s until the listing lands (bounded to 2 minutes).
  • Test: a real Nest-container spec proves the tools/list handler finds the listing recorder provided under a useExisting alias in another module — that lookup swallowed errors silently, so it needed proof.

Generated admin SDK: only the listingState hunks are added on top of main's files (a regen on this machine reorders 3,000 lines for no change).

Test plan

  • cd api && NODE_OPTIONS=--experimental-vm-modules npx jest src/slices/agent/toolCatalog src/slices/mcp green; bun run build clean.
  • cd admin && bun test slices && npx nuxt typecheck clean.
  • Live: restart an agent, open Tools right away → the footer says it is loading its tools, no "after restart" badges; a few seconds later the note disappears without reloading the page.

🤖 Generated with Claude Code

maksymhryzodub-prog and others added 3 commits September 23, 2026 15:19
… its tools (CLEAN-109)

A snapshot older than the running pod belongs to its predecessor; it now
reads as "listing pending" (no per-tool flags) instead of "this pod lacks
everything". The sheet loads through the store on every open, shows a quiet
"loading its tools" note while pending and polls until the listing lands.
A real-container test proves the recorder lookup across modules.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…109)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@maksymhryzodub-prog
maksymhryzodub-prog merged commit ecdbe4c into main Sep 23, 2026
1 check passed
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