feat: Slack file attachments, file context in AI, probe v0.6.0-rc240#375
feat: Slack file attachments, file context in AI, probe v0.6.0-rc240#375
Conversation
Support the execute_plan DSL orchestration tool gated by enableExecutePlan boolean flag, matching the existing enableDelegate pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Evaluate ai_allowed_tools_js at step level to dynamically compute the allowedTools list for AI checks, following the same pattern as ai_mcp_servers_js and ai_bash_config_js. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…robe v0.6.0-rc240 - Add extractFileSections/replaceFileSections to parse --- filename.ext --- delimiters - Upload extracted file content as Slack file snippets via files.uploadV2 - Normalize literal \n from DSL output buffer before file section extraction - Add apiForm() for form-urlencoded Slack API calls (required by file upload endpoints) - Allow file_share subtype in socket-runner so users can share attachments - Thread file attachment metadata (SlackFileAttachment) through the full pipeline: SlackClient → SlackAdapter → NormalizedMessage → AI XML context - Add formatFilesXml() to render file metadata in AI conversation context - Add JSON recovery for ProbeAgent output buffer trailing content - Update @probelabs/probe to v0.6.0-rc240 (fixes output buffer destruction during schema correction — see probelabs/probe#423) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Overview: Slack File Attachments, File Context in AI, Probe v0.6.0-rc245SummaryThis PR introduces three major features:
Files Changed Analysis25 files changed (+2680/-219 lines) Core Feature Files
AI/Review Service
MCP/Policy Tool Fixes
Configuration
TUI/Trace Viewer Improvements
Other Fixes
Tests
Dependencies
Architecture & Impact AssessmentWhat This PR Accomplishes
Key Technical Changes
Affected System Componentsgraph TD
A[AI Agent Output] --> B[slack-frontend.ts]
B --> C[extractFileSections]
C --> D[files.uploadV2 API]
D --> E[Slack File Attachment]
E --> F[Placeholder in Message]
G[User File Share] --> H[SlackSocketRunner]
H --> I[SlackAdapter]
I --> J[NormalizedMessage.files]
J --> K[AIReviewService.formatFilesXml]
K --> L[AI Context XML]
M[ProbeAgent Response] --> N[JSON.parse]
N -->|Parse Error| O[Recovery Logic]
O --> P[Extract JSON Prefix]
O --> Q[Append Trailing to text]
R[Workflow Tool] --> S[executeWorkflowAsTool]
S --> T[_rawOutput Detection]
T --> U[<<<RAW_OUTPUT>>> Wrapping]
U --> V[ProbeAgent Extraction]
MCP Tool Name Mismatch FixProblem: Workflow tools registered via Solution: Added graph LR
A[ai_mcp_servers_js] -->|server entry name| B[code-explorer]
B -->|workflow| C[tyk-code-talk]
C -->|old: workflow.id| D[tool: tyk-code-talk]
D -->|allowedTools mismatch| E[❌ Filtered out]
B -->|new: name override| F[tool: code-explorer]
F -->|allowedTools match| G[✅ Available]
Scope Discovery & Context ExpansionRelated Files (Inferred)Based on the changes, the following areas are likely affected:
Configuration Impact
Breaking ChangesNone - all changes are additive or bug fixes. Performance Considerations
Review NotesKey Areas to Review
Testing
Metadata
Powered by Visor from Probelabs Last updated: 2026-02-18T11:11:03.424Z | Triggered by: pr_updated | Commit: 2bf89a3 💡 TIP: You can chat with Visor using |
Security Issues (6)
Architecture Issues (10)
Performance Issues (9)
Quality Issues (19)
Powered by Visor from Probelabs Last updated: 2026-02-18T11:11:07.606Z | Triggered by: pr_updated | Commit: 2bf89a3 💡 TIP: You can chat with Visor using |
When execute_plan uses output(), the data must reach the end user without any intermediate LLM rewriting it. This commit implements the full passthrough chain: - parseAIResponse: extract <<<RAW_OUTPUT>>> blocks before JSON parsing, attach as _rawOutput on the parsed output object - workflow-check-provider: propagate _rawOutput from step outputs to workflow-level output - workflow-tool-executor: wrap _rawOutput in <<<RAW_OUTPUT>>> delimiters when returning tool result, so the calling ProbeAgent extracts it via extractRawOutputBlocks (bypassing the LLM) - slack-frontend: append _rawOutput to rendered text so file sections (--- filename.ext ---) get extracted and uploaded Also updates @probelabs/probe to 0.6.0-rc245 which includes the ProbeAgent-side change (appending output buffer with RAW_OUTPUT delimiters for schema responses). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
--- filename.ext ---delimiters: AI output containing--- report.csv ---sections gets extracted, uploaded as Slack file snippets viafiles.uploadV2, and replaced with placeholders in the message textfile_sharemessages now thread file metadata (name, mimetype, size, URL) through the full pipeline into the AI's XML conversation contexttextfieldChanges
Slack file upload pipeline
src/slack/markdown.ts—extractFileSections()/replaceFileSections()to parse--- filename.ext ---delimiterssrc/frontends/slack-frontend.ts— extract file sections, upload via Slack API, replace with placeholders; normalize literal\nfrom DSL outputsrc/slack/client.ts—apiForm()for form-urlencoded Slack API calls (required by file upload endpoints);filesinfetchThreadRepliesFile attachment context
src/types/bot.ts—SlackFileAttachmentinterface,filesfield onNormalizedMessagesrc/slack/adapter.ts— threadfilesthroughSlackMessage,fetchConversation,normalizeSlackMessagesrc/slack/socket-runner.ts— passev.files, allowfile_sharesubtypesrc/ai-review-service.ts—formatFilesXml()renders file metadata in AI XML contextJSON recovery
src/ai-review-service.ts— recover valid JSON prefix when trailing output buffer content causes parse errorsOther
package.json—@probelabs/probe^0.6.0-rc240Test plan
tests/unit/slack-file-sections.test.ts— 25 tests for extraction, replacement, edge cases, literal\nnormalizationtests/unit/providers/mcp-allowed-tools-mismatch.test.ts— allowed tools tests🤖 Generated with Claude Code