Skip to content

Make the chat agent platform-aware (Slack/Discord/Linear)#704

Open
0xdiid wants to merge 3 commits into
paradigmxyz:mainfrom
0xSplits:feat/discord-platform-aware-context
Open

Make the chat agent platform-aware (Slack/Discord/Linear)#704
0xdiid wants to merge 3 commits into
paradigmxyz:mainfrom
0xSplits:feat/discord-platform-aware-context

Conversation

@0xdiid

@0xdiid 0xdiid commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

We've been having issues on our Discord + Linear ingress where the agent mistakenly thinks it's in Slack, mostly due to a lot of Slack-specific stuff that was a part of that initial implementation. It figured it out after 2/3 turns but that's just wasted tokens, and looks bad in the chain of thought.

This teaches it where it actually is: every turn now carries a short note about which chat surface it's on and where its reply should go, and the base instructions no longer assume Slack. The session context and the SDK report the platform either way.

The Discord side also gains the ability to send and pull down files, matching what Slack already had.

Validated:

Screenshot 2026-06-23 at 12 27 09 PM Screenshot 2026-06-23 at 9 19 30 PM

0xdiid and others added 2 commits June 23, 2026 15:47
Discord-ingress sessions reused the Slack-only system prompt and session
context, so the agent assumed it was on Slack. Now the chat surface is
resolved from the thread key into a shared ChatDestination, a terse
platform/destination note is injected into each user turn so the model
always knows where it is, the session-context API and SDK expose platform
plus Slack/Discord destinations, the system prompt is platform-neutral,
and the Discord tool gains file upload/download parity with Slack.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Linear issue threads now get the same chat-surface treatment as Slack and
Discord: the per-turn note, the /api/session context block, the SDK helpers,
and the system prompt all recognize linear: thread keys. The note reflects
Linear's reality — replies are auto-posted as issue comments and there is no
file-upload surface, so it points at inline/link sharing and fetch-asset
downloads instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@0xdiid 0xdiid force-pushed the feat/discord-platform-aware-context branch from 9be6a64 to e8986c9 Compare June 23, 2026 22:02
@0xdiid 0xdiid changed the title Make the chat agent platform-aware (Slack/Discord) Make the chat agent platform-aware (Slack/Discord/Linear) Jun 23, 2026
Two follow-ups from review of the platform-aware-context change.

discord download_url accepted any URL and buffered the whole body in
memory, so a steered agent could aim it at an internal host and there was
no ceiling on download size. It now rejects non-Discord-CDN hosts and
streams to disk under a size cap, mirroring the Slack downloader; the
message-attachment path also basenames the Discord-supplied filename so it
can't escape the output directory.

The message-listing commands now print attachment ids and urls in their
default output, so an agent can actually find the file to download instead
of only seeing it under --json.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@0xdiid 0xdiid marked this pull request as ready for review June 24, 2026 04:21
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