Skip to content

feat(slack): Add file-capable sendMessage - #744

Merged
dcramer merged 11 commits into
mainfrom
feature/send-message-files
Jul 5, 2026
Merged

dcramer merged 11 commits into
mainfrom
feature/send-message-files

Conversation

@dcramer

@dcramer dcramer commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

Slack channel and thread delivery now flows through sendMessage, a file-capable side-effect tool with target: "channel" | "thread", text, and files. Channel-target sends satisfy channel post requests without a duplicate thread reply, while thread-target sends can attach generated or sandbox files in the current Slack thread.

The related reaction side effect is exposed as addReaction so context-bound Slack tools use short action-oriented camelCase names. Generated image outputs are persisted to /tmp/junior/artifacts/..., and attachFile/sendMessage materialize attachments from sandbox paths instead of relying on same-turn in-memory generated-file state. The Slack eval helpers now use Slack-shaped message timestamps so reaction evals exercise the same target boundary as production Slack events.

Refs #737

@vercel

vercel Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jul 5, 2026 9:03pm

Request Review

@dcramer
dcramer marked this pull request as ready for review July 2, 2026 23:09
@github-actions github-actions Bot added the risk: high PR risk score: high label Jul 2, 2026
dcramer added a commit that referenced this pull request Jul 4, 2026
Base channel-only reply suppression on successful sendMessage side effects instead of natural-language intent matching. Keep pending attachFile artifacts in the thread delivery plan and document the agentic semantics policy.

Refs GH-744

Co-Authored-By: GPT-5 Codex <[email protected]>
dcramer added a commit that referenced this pull request Jul 4, 2026
Allow sendMessage to send text or files into the current Slack thread while preserving channel posts as explicit top-level side effects. Add focused Slack message delivery eval coverage for thread versus channel target selection.

Refs GH-744

Co-Authored-By: GPT-5 Codex <[email protected]>
dcramer added a commit that referenced this pull request Jul 5, 2026
Base channel-only reply suppression on successful sendMessage side effects instead of natural-language intent matching. Keep pending attachFile artifacts in the thread delivery plan and document the agentic semantics policy.

Refs GH-744

Co-Authored-By: GPT-5 Codex <[email protected]>
dcramer added a commit that referenced this pull request Jul 5, 2026
Allow sendMessage to send text or files into the current Slack thread while preserving channel posts as explicit top-level side effects. Add focused Slack message delivery eval coverage for thread versus channel target selection.

Refs GH-744

Co-Authored-By: GPT-5 Codex <[email protected]>
@dcramer
dcramer force-pushed the feature/send-message-files branch from f6365f8 to 41f2153 Compare July 5, 2026 17:32
dcramer and others added 8 commits July 5, 2026 13:03
Replace the channel-post-only Slack tool with sendMessage so the agent can send text, sandbox files, or both through one side-effect surface. Generated images are written to sandbox artifact paths before the tool returns, and later Slack file sends materialize those paths through the sandbox file upload helper.

Remove the in-memory generated-image fallback for attachFile so file-like outputs that need to survive tool boundaries are represented by explicit handles. Update the prompt/spec contracts and add unit, component, integration, and eval coverage for the new boundaries.

Refs #737
Co-Authored-By: GPT-5 Codex <[email protected]>
A file-only sendMessage can satisfy the user's request without producing final assistant text or replyFiles. Count successful sendMessage tool results as channel-only side effects when there are no tool errors, so the turn does not get classified as an execution failure after Slack already received the message.

Refs #737
Co-Authored-By: GPT-5 Codex <[email protected]>
Base channel-only reply suppression on successful sendMessage side effects instead of natural-language intent matching. Keep pending attachFile artifacts in the thread delivery plan and document the agentic semantics policy.

Refs GH-744

Co-Authored-By: GPT-5 Codex <[email protected]>
Allow sendMessage to send text or files into the current Slack thread while preserving channel posts as explicit top-level side effects. Add focused Slack message delivery eval coverage for thread versus channel target selection.

Refs GH-744

Co-Authored-By: GPT-5 Codex <[email protected]>
Classify sendMessage completion from its structured target so thread-target side effects do not satisfy channel-only finalization. Use source thread coordinates for thread sends while keeping channel sends on the destination channel.

Document the testing split between deterministic Slack tool integration tests and eval coverage for model tool-target choice.

Co-Authored-By: GPT-5 Codex <[email protected]>
Avoid top-level channel uploads when sendMessage is called with files and no explicit target. Keep text-only compatibility on the channel default, while explicit channel file sends continue to post top-level.

Co-Authored-By: GPT-5 Codex <[email protected]>
Normalize sendMessage optional fields under the tool policy and keep file uploads targeted to the current thread unless channel delivery is explicit.

Expose Slack file uploads in eval transcripts as assistant posts with text and files so attachment behavior can be asserted directly.

Co-Authored-By: GPT-5 Codex <[email protected]>
Align Slack sendMessage tests with the typed Slack ID and timestamp boundaries added on main after the rebase.

Co-Authored-By: GPT-5 Codex <[email protected]>
Comment thread packages/junior/src/chat/agent/tools.ts Resolved
Replace stale channel-post terminology in Slack action guidance with the sendMessage channel target vocabulary used by the tool API.

Co-Authored-By: GPT-5 Codex <[email protected]>
Expose reaction delivery as the short camelCase addReaction tool so Slack side-effect tools use consistent action-oriented names alongside sendMessage.

Update eval fixtures to use Slack-shaped message timestamps so reaction tool evals exercise the real runtime target boundary.

Co-Authored-By: GPT-5 Codex <[email protected]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5216f5b. Configure here.

@dcramer dcramer changed the title feat(chat): Add file-capable Slack sendMessage feat(slack): Add file-capable sendMessage Jul 5, 2026
Track generated files only after sandbox artifact writes complete, and treat Slack file upload responses without file metadata as successful uploads with no returned ids.

Co-Authored-By: GPT-5 Codex <[email protected]>
@dcramer
dcramer merged commit c9640d6 into main Jul 5, 2026
19 checks passed
@dcramer
dcramer deleted the feature/send-message-files branch July 5, 2026 21:17

This branch was successfully deployed

1 active deployment
Preview – junior-docs — c43194a2 Deployed Jul 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant