Skip to content

[Fix] Suggested tasks start in a new Slack thread when launched from Fast reports - #2307

Open
roomote-roomote[bot] wants to merge 4 commits into
developfrom
fix/suggestion-origin-thread-329logj4ks3rj
Open

[Fix] Suggested tasks start in a new Slack thread when launched from Fast reports#2307
roomote-roomote[bot] wants to merge 4 commits into
developfrom
fix/suggestion-origin-thread-329logj4ks3rj

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

​Opened on behalf of @mrubens. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

What changed

  • Keep Fast automation suggestion launches in the originating Session and Slack report thread, including the initial "Started by" announcement, live task card, and Fast continuation.
  • Resolve the canonical Session when publishing Fast suggestions and persist its ID on tracked cards across Slack, Discord, Teams, and Telegram. Launch consumers preserve that provenance instead of relying exclusively on a source task.
  • Preserve existing task-backed suggestion behavior. A persisted origin that no longer exists fails rather than silently starting in a different Session.
  • Export requireFastSuggestionOriginSessionId(fastConversationId) from the SDK server and suggestion module so other publishers can use the same canonical lookup. Taskless Slack message metadata now carries sourceTaskId: null, not an automation event ID.
  • Resolve the origin before router-backed Fast dispatch on Discord, Telegram, and Teams, not only pinned task dispatch. Reuse the existing canonical conversation and reply destination; Discord also aligns history and delegation metadata and drops clicked-card reply anchors when the destination differs.

Why this change was made

Fast automation reports can publish suggestions without a source task. Their work items correctly have sourceTaskId: null, but the publisher also omitted the originating Session. Slack reactions only resolved origins through the source task, so they posted a new channel-root announcement even though the report's Session already had the correct Slack thread binding. This is a separate path from the task-backed publication fixed in #2277.

Impact

New Fast report cards retain Session ownership from publication through launch. No Session is created lazily to recover the origin, and card timestamps do not become the routing authority. No schema migration or historical backfill is included: existing taskless cards without origin metadata need a newly generated report. Live Slack delivery and the deployed version associated with the original report have not been verified.

How it was tested

  • 165 focused API tests across Slack reactions, shared launch resolution, and Discord/Telegram/Teams claim and launch paths passed.
  • The review follow-up passed 235 tests across eight API suites, covering taskless router-backed cards on each affected surface, both Teams entry paths, canonical reply routing, and claim failure handling. API typechecking and final pre-push gates passed.
  • 77 SDK publisher/parent-event tests and 2 DB tracked-card tests passed, including canonical Session versus Fast conversation ID propagation and metadata persistence.
  • 2 real-database cloud-agent tests passed for distinct suggested tasks staying in one automation Session and report thread.
  • 2 Slack metadata tests passed for task-backed and taskless payloads. The shared-helper follow-up also passed all 77 SDK tests and SDK/Slack typechecks.
  • Both taskless Slack launch regressions failed with origin propagation removed: the announcement omitted thread_ts. They pass with the fix restored.
  • API, SDK, and DB TypeScript checks passed. Pre-push repository-wide oxlint, residual ESLint, fast typechecks, and knip passed.
  • Browser proof is not applicable to this backend provenance/transport change; Slack calls are asserted in tests, not replayed against a live workspace.

Checklist

  • The PR title follows the repo convention: [Fix], [Feat], [Improve], [Refactor], [Docs], or [Chore] followed by a user-facing description
  • This PR is small and scoped to one change
  • pnpm lint and pnpm check-types pass locally
  • I added tests or included a clear manual validation note above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset

Validation used the scoped TypeScript checks and repository pre-push gates described above rather than the two full commands in the checklist. No changeset was added.

@roomote-community

roomote-community Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

No code issues found. See task

  • Preserve the persisted automation Session for router-backed Fast suggestion launches on Discord, Telegram, and Teams.

Reviewed 21469cc

Comment thread apps/api/src/handlers/discord/callback-actions.ts Outdated
@roomote-roomote

roomote-roomote Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the outstanding router-backed Fast launch finding in 21469cc0.

  • Discord, Telegram, and both Teams entry paths reuse the originating Session's canonical conversation before Fast dispatch.
  • Taskless router-card regressions cover original conversation/reply routing and claim failure handling.
  • 235 focused API tests, API typechecking, and pre-push lint/typecheck/knip gates passed.
  • GitHub's Roomote code review, Test, Type Check, Lint, Knip, CodeQL, and app Docker build checks all passed on this commit.

The review thread is resolved and PR metadata refreshed. Live provider replay was not performed.

@roomote-roomote
roomote-roomote Bot marked this pull request as ready for review September 7, 2026 04:28
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