feat(desktop): auto-open agent reply threads - #5563
Open
michaelzeyuchen wants to merge 1 commit into
Open
Conversation
Open the originating thread when a known agent returns a hidden NIP-10 reply to the user's most recent agent-targeted message. The policy is exact and one-shot, yields to active auxiliary panels, and guards deferred state changes across channel navigation. Live events flow through useChannelSubscription with the onLiveEvent hook added solely for this feature; the agent-reply hook owns the subscription so the feature-specific callback does not leak into the general-purpose subscription API. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Michael Ze Yu Chen <michael@Michaels-MacBook-Pro.local>
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.
Summary
When a user sends a top-level message targeting a known channel agent, automatically open the originating thread when that agent returns a hidden NIP-10 reply.
Previously, the reply landed correctly but rendered only inside the closed thread panel, so the active exchange appeared to leave the conversation until the user clicked the reply summary.
Behavior
The policy is intentionally narrow:
Delegated relay attribution remains trust-bound:
resolveEventAuthorPubkeyaccepts actor/p tags only from the relay identity advertised by NIP-11.Implementation
decideAgentReplyAutoOpenpolicyonLiveEventcallback inuseChannelSubscription, consumed only by the dedicated hooknode:testcasesChannelScreen.tsxremains within the file-size ratchet at 998/1000 lines.Verification
From
desktop/:pnpm exec biome check(feature files) — passpnpm run typecheck— passnode:test— 8/8 passpnpm run check:file-sizes— passpnpm run check:px-text— passpnpm run check:pubkey-truncation— passNot run locally: full Rust/Tauri workspace CI; GitHub Actions will exercise it.
🤖 Generated with Claude Code