Skip to content

feat(chat): Add file-capable Slack sendMessage#744

Open
dcramer wants to merge 2 commits into
mainfrom
feature/send-message-files
Open

feat(chat): Add file-capable Slack sendMessage#744
dcramer wants to merge 2 commits into
mainfrom
feature/send-message-files

Conversation

@dcramer

@dcramer dcramer commented Jul 2, 2026

Copy link
Copy Markdown
Member

Slack channel posting now uses a sendMessage tool that can send text, sandbox files, or both in one Slack side effect. File sends use Slack file upload with an optional initial comment, so file-only messages do not emit an empty chat.postMessage, and successful sendMessage calls satisfy the turn without duplicate thread replies.

Generated image outputs are written to /tmp/junior/artifacts/... before imageGenerate returns a model-visible path. attachFile and sendMessage materialize files from sandbox paths instead of a same-turn in-memory generated-file fallback, so process memory is only a cache across tool, delivery, resume, and later-turn boundaries.

Refs #737

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 <codex@openai.com>
@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 2, 2026 11:20pm

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
Comment thread packages/junior/src/chat/services/turn-result.ts
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 <codex@openai.com>

@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.

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 1e87c5b. Configure here.

explicitChannelPostIntent: exactNoReplyMarker && explicitChannelPostIntent,
explicitChannelPostIntent:
(exactNoReplyMarker && explicitChannelPostIntent) ||
channelMessageOnlySuccess,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Channel mode drops thread attachments

Medium Severity

When a turn succeeds with sendMessage and no assistant text, channelMessageOnlySuccess is treated as explicit channel-post intent. If attachFile also populated replyFiles, delivery becomes channel_only with attachFiles: none, so thread attachments are skipped even though they previously delivered in thread mode.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1e87c5b. Configure here.

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