Skip to content

fix(slack): revert to /decopilot/stream — /runtime/stream requires taskId#438

Merged
JonasJesus42 merged 1 commit into
mainfrom
slack-revert-to-stream-endpoint
May 13, 2026
Merged

fix(slack): revert to /decopilot/stream — /runtime/stream requires taskId#438
JonasJesus42 merged 1 commit into
mainfrom
slack-revert-to-stream-endpoint

Conversation

@JonasJesus42
Copy link
Copy Markdown
Contributor

@JonasJesus42 JonasJesus42 commented May 13, 2026

Summary

Follow-up to #436/#437. Real traffic on the /decopilot/runtime/stream endpoint hits streamCore: 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's streamAgent helper. We still omit thread_id (decopilot rejects ids it did not mint).

The userNamethreadId plumbing in llm-handler.ts / eventHandler.ts stays in place so we can wire a real thread-create call later if per-person decopilot memory becomes a requirement.

Test plan

  • Send a DM → pod logs show [LLM] POST <meshUrl>/api/<org>/decopilot/stream and the bot replies.
  • No more streamCore: taskId is required errors.
  • Slack-thread context survives within a thread (proved by sending a follow-up — context comes from buildContextMessages, not decopilot memory).

Summary by cubic

Reverted Slack MCP LLM streaming to the chat endpoint to stop taskId is required errors and restore replies. We now call /api/<org>/decopilot/stream directly and parse its SSE output locally.

  • Bug Fixes
    • Switched from /decopilot/runtime/stream to /decopilot/stream so no pre-existing taskId is needed.
    • Replaced streamAgent from @decocms/runtime/decopilot with a direct fetch and lightweight SSE parser.
    • Continue omitting thread_id; context comes from Slack history. Kept userNamethreadId plumbing for future thread creation.

Written for commit adaada1. Summary will update on new commits.

…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>
@JonasJesus42 JonasJesus42 merged commit e05c7fc into main May 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant