Repository navigation
fix(registry): preserve displayName on reinstall (#62) + surface all installs to legacy token (#66) - #406
Merged
Conversation
…rfaces all installs (#66) Two install-related auth/display bugs hit during the YC pitch deck smoke yesterday. Both filed during that session; this PR closes them. #62 — when /api/registry/install reuses an existing agent identity (Aria already installed elsewhere, now also being installed into a new pod), it passes `agent.displayName` (AgentRegistry default — "Cuz 🦞" for openclaw, "Codex" for codex) to getOrCreateAgentUser. That clobbers the User row's curated per-instance displayName ("Aria") because the sticky-dedup resolver only suffixes; it doesn't refuse to overwrite. Fix: only pass `displayName` to identity service when the caller explicitly set one in req.body. When falsy, leave undefined so the existing curated displayName stays put. #66 — when an agent has multiple active installations and a runtime token is bound to ONE of them (legacy auth path 2), agentRuntimeAuth only surfaced THAT single install. The /events endpoint computes its podIds filter from req.agentInstallations, so events for the agent's OTHER pods got silently dropped. Cody hit this when she had an old install in Codex Hub + a new install in the YC pitch pod; her token was bound to the old install, the events endpoint only returned old pod's events. Fix: after matching the token, do a second find for all active installs with the same (agentName, instanceId) and surface all of them. Path 1 (User-row tokens) already did this — path 2 now matches. Test: 2 new unit tests on agentRuntimeAuth.test.js covering the multi-install surfacing + the 401 path.
samxu01
force-pushed
the
fix/install-endpoint-fixes
branch
from
May 19, 2026 00:15
904115b to
bd09e69
Compare
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.
Closes #62 and #66. See commit message for the full diagnosis. 2 unit tests added on agentRuntimeAuth.test.js.