test(desktop): emit an authorizable 46040 in the channel presence spec - #141
Merged
Merged
Conversation
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This was referenced Aug 11, 2026
channel-agent-presence.spec.ts: needs-you dot never renders for a 46040 request (fails on main)
#130
Closed
devin-ai-integration
Bot
force-pushed
the
devin/1786410067-fix-130-presence-needs-you
branch
from
August 11, 2026 09:28
74b2a96 to
8927391
Compare
Base automatically changed from
devin/1786360520-fix-110-channel-question-card
to
main
August 11, 2026 12:27
Keep mock user-input requests durable so late subscribers can hydrate them. Seed canonical causal parents and expose the owner-declared relay agent so authority validation matches a real relay. Generate valid 64-hex default event ids for mock events. Fixes #110 Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Oscar Le <oscar.lehuu@gmail.com>
Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Oscar Le <oscar.lehuu@gmail.com>
Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Oscar Le <oscar.lehuu@gmail.com>
Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Oscar Le <oscar.lehuu@gmail.com>
devin-ai-integration
Bot
force-pushed
the
devin/1786410067-fix-130-presence-needs-you
branch
from
August 11, 2026 14:20
8927391 to
0b936f6
Compare
Keep main e2eBridge and decision log; add D-040 fixture-authority rule from this PR. Spec fixture changes for #130 are unchanged.
…130-presence-needs-you
…130-presence-needs-you
…130-presence-needs-you
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
Cause: (a) harness-fidelity gap. No product break — zero production source changes in this PR.
channel-agent-presence.spec.ts › shows needs-you for a 46040 requestfaked the request through the generic__BUZZ_E2E_EMIT_MOCK_MESSAGE__withkind: 46040and anhtag only. Production is right to drop that event, soneedsYouStorestayed empty andderiveChannelAgentPresencenever produced aneeds-youentry for the header dot:The fix is fixture-side: the spec now emits what a real conversation produces — an owner kind:9 message mentioning the agent as the causal root, then the agent's 46040 as a canonical reply to it via #126's
__BUZZ_E2E_EMIT_MOCK_USER_INPUT__helper (durable, ownerptag, canonicaleroot/reply, 64-hex ids). Assertions are unchanged; nothing is skipped, relaxed, or newly waited on.Each fixture change maps to the production rule that demanded it:
eroot/reply tags on the requestdesktop/src/features/channels/lib/userInput.ts:168-190(deriveUserInputRootEventId)ptag == current identity; 64-hexid/pubkey;request.channel_id == hdesktop/src/features/agents/userInputAttentionProjection.ts:225-256(validateAuthorizedUserInputRequest)h,p-targets the agent, and roots the ancestrydesktop/src/features/agents/userInputAttentionProjection.ts:95-145(validatesRequestTrigger)desktop/src/testing/e2eBridge.ts:10412-10468(from #126, used unchanged)desktop/src/features/channels/ui/ChannelAgentPresence.tsx:172-182— click-through resolves the conversation from a timeline messageWhy #126's relay-registry fix does not apply here: the agent in this spec is a seeded managed agent, and
seedMockManagedAgents(e2eBridge.ts~2374-2390) already sets its profileowner_pubkey = MOCK_IDENTITY_PUBKEY, which is whatuseCurrentOwnedAgentPubkeys→mergeOwnedAgentPubkeysfilters on. SoownedAgent(...)already passed; only the causal/owner tagging was missing. No registry change was copied.USER_INPUT_EVENT_ID→USER_INPUT_ROOT_EVENT_ID, since the constant now names the causal root rather than the request.CONVERSATION_IDis unchanged and still correct:deriveAgentConversationId(CHANNEL_ID, "c".repeat(64)) = afab2e62-a520-f16b-e63d-b291c2f679c9.Stacked on #126 (base branch
devin/1786360520-fix-110-channel-question-card), per the issue's instruction to reuse that helper rather than duplicate fixture logic — this spec needs #126's durable request, seeded canonical parent, and 64-hexcreateMockEventids. Retarget tomainonce #126 lands.Docs: took decision slot D-040 (allocated by the orchestrator; D-028…D-039 are taken by in-flight PRs) to record the rule this class of bug keeps re-teaching — E2E fixtures may only emit events production could produce.
STATE.mdupdated for the anti-drift rule.Related issue
Fixes #130. Same family as #110 (PR #126) but a different surface (header presence dot via the attention projection) and a different fixture path.
Testing
RED on clean
origin/main@35af74019(bundle rebuilt, no branch changes):GREEN on this branch (
pnpm --filter buzz build:e2e, thenxvfb-run -a pnpm exec playwright test --project=smoke channel-agent-presence.spec.ts):Not a coin flip — 12 consecutive runs, 24/24 tests passed, 0 flakes (6.0–6.2s each).
Also green:
pnpm --filter buzz check,pnpm --filter buzz typecheck, andpnpm --filter buzz test(5045 passed / 0 failed / 1 skipped).No visual change: the dot the spec asserts on is the existing
needs-youstate, now reachable.Link to Devin session: https://app.devin.ai/sessions/b8611f3bb00946c786b45eea07c83785
Requested by: @oscarlehuu