Skip to content

fix(copilot): store tool file outputs from workspace chats under the Copilot user - #8680

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/execution-file-scope
Oct 6, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/execution-file-scope

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Copilot tool calls that return a file (e.g. an email attachment download) failed in workspace chats with "Execution file output requires a complete trusted execution scope"
  • Every Copilot turn carries its own executionId (the turn's identity) but a workspace chat has no workflowId, and resolveFileStorageScope treated any executionId as a workflow run
  • A Copilot turn with no workflow now stores its files under the Copilot user, the same as the in-band tool route already did
  • Workflow runs and Mothership blocks (Copilot running inside a real workflow execution) keep storing files in that execution, unchanged

Type of Change

  • Bug fix

Testing

  • file-result.server.test.ts: the Copilot fixture now carries an executionId like real Copilot calls; 7 Copilot-path tests fail on the pre-fix code and pass with the fix
  • New case pins a Mothership block's files to its parent workflow run (fails if the guard drops the workflowId check)
  • lib/internal/tool-operations + tools/index suites (199 tests), bun run lint, bun run type-check, bun run check:audits, docs-manifest:check, block-registry check, test:scripts

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 6, 2026 4:19pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes file storage routing for copilot tool outputs.

The PR appears safe to merge; the reviewed storage paths preserve their intended ownership and scope.

Summary

The PR routes file outputs from workflowless Copilot turns to user-owned Copilot storage while retaining execution storage for workflow-backed turns.

  • Updates the Copilot test fixture to include a turn execution ID.
  • Adds a test that keeps Mothership block files in their parent workflow run.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Tool returns file] --> B{Copilot turn without workflow ID?}
  B -->|Yes| C[Store under Copilot user]
  B -->|No, execution ID present| D[Store under workflow execution]
Loading

Reviews (1) · Last reviewed commit: "fix(copilot): store tool file outputs fr..."

@waleedlatif1
waleedlatif1 merged commit 32a7f8e into staging Oct 6, 2026
24 of 25 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/execution-file-scope branch October 6, 2026 16:26

This branch was previously deployed

1 inactive deployment
Preview — 0d1bdbb5 Deployed Oct 6, 2026 by vercel[bot]
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