[Refactor] Generalize Fast conversation routing for Discord - #1454
Conversation
|
No code changes since the prior review; 1 issue remains outstanding. See task
Reviewed 895cb9f |
a5637ef to
6a4591d
Compare
eeabd74 to
494e77f
Compare
| ? {} | ||
| : { communicationGuildId: params.conversation.workspaceId }), | ||
| ...(thread ? { discordTaskThread: true } : {}), | ||
| ...buildFastAgentChildTaskMetadata({ |
There was a problem hiding this comment.
communicationContextInherited suppresses the child runtime's normal reply environment, but it does not suppress worker request_user_input delivery. The worker still registers Discord RUI for every Discord payload, and publishCommunicationRequestUserInput posts to this child task's communicationChannelId/communicationThreadId without checking the inherited flag. A Fast-delegated Discord task that asks a question will therefore show its buttons in the child thread, splitting user-visible delivery away from the parent Fast conversation. Route that flow through the parent or skip the child-side RUI for inherited contexts.
6a4591d to
ac34c3b
Compare
494e77f to
f3397ad
Compare
f3397ad to
895cb9f
Compare
What
launch_taskavailable during Discord lifecycle turns through a shared Fast task launcherWhy
Discord slash interaction IDs were serving two unrelated jobs: identifying Fast memory and identifying where later lifecycle messages should be posted. An interaction ID is not a Discord channel or thread, so a delegated task could retain the right parent session but later attempt delivery to an invalid destination.
The Fast conversation contract now models those concerns independently:
conversationIdscopes memory and turn serializationreplyTargetis the provider-native channel/thread addressFast child metadata is also constructed as one invariant: the parent stamp, session ID, and inherited-context flag are emitted together. This keeps lifecycle routing coordinates available while preventing the child runtime from treating them as its own direct reply surface.
Slack and Discord use the same contract and shared enqueue/kickoff mechanics, while provider-specific code only constructs the provider task payload and performs delivery.
Impact
Validation
pnpm lintpnpm check-typespnpm knipprocess.cwd()as outside/tmp, while the PR worktree itself is under/private/tmpMock Discord smoke
The checked-in Discord mock harness exercised a guild
/fastrequest through delegation, child-thread creation, a settled child event, and Fast lifecycle closeout. The closeout posted to the real parent channel, and no request targeted the slash interaction ID.A second focused guild
/fastsmoke inspected the persisted child payload. Both the initial child run and its automatic startup retry carriedcommunicationContextInherited: true; the worker regression test resolves the same payload to no direct Discord reply context. The local compute provider failed before the child reached an agent turn, so this proves launch-payload ownership rather than a successful sandbox execution.Temporary smoke fixtures were removed after verification.