fix(sidebar): gate working pill on NIP-OA ownership#1415
Draft
tellaho wants to merge 9 commits into
Draft
Conversation
Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
4516c77 to
a8d1501
Compare
Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
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.
What
The sidebar "working" pill currently only lights for agents the local build manages. This makes it light for any agent the viewer OWNS (declared NIP-OA owner), regardless of which machine hosts it — matching the
viewerIsOwnersignal used everywhere else in the UI. Before this change, an owned-but-remote agent showed no pill.How
A single-site change in the sidebar working-pill bridge (
desktop/src/features/sidebar/lib/useActiveWorkingChannelsById.ts):getOwnedRelayWorkingAgentscollects relay agents whose profileownerPubkeymatches the current viewer (normalized, case-insensitive — same rule asviewerIsOwneratMembersSidebar.tsx:581).mergeWorkingAgentsmerges those owned-remote agents with locally-managed agents asstatus: "deployed"and feeds the merged set into the existing observer + active-turn bridges. Managed agents win duplicate pubkeys (managed-first, case-insensitiveseenPubkeys).Why the relay posture is preserved (not loosened where it matters)
#p:[identity.pubkey]with server-sideis_agent_owner. A viewer only ever receives observer frames for agents the relay has already confirmed they own.hasActiveAgentstart-gate,knownAgentPubkeysframe-trust set) were a strictly-narrower local-custody filter layered on top. This re-keys them to declared ownership so the client matches the relay's existing ownership scope — it grants no access to anything the relay wouldn't already stream.ownerPubkey === youadds a pubkey to the trust set, but no frames arrive unless the relay actually streams them (real ownership required), and thesender == agentdefense-in-depth check (observerRelayStore) is untouched. A client-side profile claim cannot manufacture telemetry access.sidebar/lib.observerRelayStore.ts,ChannelScreen.tsx, and the profile panel are untouched.Tests
getOwnedRelayWorkingAgents/mergeWorkingAgentsunit coverage: owner-match, non-owned drop, no-viewer empty, case-insensitive dedupe (managed wins), owned-relay name resolution, and the ownerless-relay-agent guard (missing profile in batch +ownerPubkey: nullboth drop to[]).biome check .green,pnpm --dir desktop typecheckgreen, full desktop suite 1393 / 0 failures (sidebar + agents slice green incl. the new helper tests).Follow-up (not in this PR)
OWNED_RELAY_AGENT_PUBKEYfixture exists, but seeding an observer working frame for an owned-remote agent and asserting the pill appears would require building an observer-frame seed harness that doesn't exist yet. Disproportionate here; worth a follow-up e2e someday.Rollback
Revert the implementation commit — both bridges fall back to
managedAgents.Co-authored-by: Taylor Ho taylorkmho@gmail.com
Signed-off-by: Taylor Ho taylorkmho@gmail.com