fix(slack): revert to /decopilot/stream — /runtime/stream requires taskId#438
Merged
Conversation
…skId After #436 switched to the runtime endpoint /api/<org>/decopilot/runtime/stream (the path the AgentOf binding uses internally) and #437 dropped thread_id, real traffic hits `streamCore: taskId is required`. The runtime stream is the resume-a-task path: it expects a pre-existing taskId minted by another call. For our chat-like webhook flow there is no upstream task. Go back to /decopilot/stream — the user-facing chat endpoint studio's own chat UI uses — and parse its custom SSE locally instead of through the runtime's `streamAgent`. We still omit thread_id (decopilot rejects ids it did not mint). The handler/event plumbing for userName -> threadId stays in place so we can wire a real thread-create call later if needed. Build, types, lint all clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.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.
Summary
Follow-up to #436/#437. Real traffic on the
/decopilot/runtime/streamendpoint hitsstreamCore: taskId is required— that endpoint is the resume-a-task path used internally by the AgentOf binding when there's already an upstream task. For our chat-like webhook flow there is no taskId.Revert to
/api/<org>/decopilot/stream— the user-facing chat endpoint studio's own UI uses — and parse its custom SSE stream locally instead of going through the runtime'sstreamAgenthelper. We still omitthread_id(decopilot rejects ids it did not mint).The
userName→threadIdplumbing inllm-handler.ts/eventHandler.tsstays in place so we can wire a real thread-create call later if per-person decopilot memory becomes a requirement.Test plan
[LLM] POST <meshUrl>/api/<org>/decopilot/streamand the bot replies.streamCore: taskId is requirederrors.buildContextMessages, not decopilot memory).Summary by cubic
Reverted Slack MCP LLM streaming to the chat endpoint to stop
taskId is requirederrors and restore replies. We now call/api/<org>/decopilot/streamdirectly and parse its SSE output locally./decopilot/runtime/streamto/decopilot/streamso no pre-existingtaskIdis needed.streamAgentfrom@decocms/runtime/decopilotwith a direct fetch and lightweight SSE parser.thread_id; context comes from Slack history. KeptuserName→threadIdplumbing for future thread creation.Written for commit adaada1. Summary will update on new commits.