Skip to content

fix(mothership): follow-ups for v1.0.0 regressions - #8215

Merged
waleedlatif1 merged 7 commits into
stagingfrom
fix/mothership-revamp-regressions
Sep 24, 2026
Merged

waleedlatif1 merged 7 commits into
stagingfrom
fix/mothership-revamp-regressions

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Follow-ups to #8208 for regressions and gaps found auditing it against staging.

  • Stored file references: workflow inputs could reference stored files by key, id, or internal URL and get them granted to the run, so an anonymous public-API, public MCP, or webhook caller could pull other workflows' or workspace files into a run. Only workspace-member principals now resolve workspace-wide; everyone else can only reference files from their own execution (keeps chat and webhook uploads working). Internal-URL uploads from non-members go through the same check instead of downloading with the run user's access.
  • Table secrets in sim_cli: Copilot table reads moved to sim_cli and lost the row secret provenance import, so persisted secrets in cells reached the model unredacted. Row use cases now report provenance to the CLI transport, which activates it for redaction; row-bearing results without provenance, run-state/enrichment error text, and export download links are withheld.
  • Google Calendar scopes: feat(mothership): v1.0.0 #8208 added calendar.readonly to Calendar's delegation scopes, which broke indexed admin-mode Calendar syncs whose delegation only authorizes calendar.events.readonly. Live service search now reads the all-day time zone from events.list and runs on the same single scope as indexing, like Drive and Gmail. The admin picker keeps calendar.readonly.
  • Search Show more: the new strict limit check in the knowledge search placeholder blanked the org search results on Show more; the page-owned path now keeps results painted while the tool-owned Search tab stays strict.
  • Activity dot: resource panel dot used undefined --brand-primary (invisible); back to --brand-blue.
  • Connector auth: restored the connector auth guidance lost with the Copilot VFS in the v2 contract descriptions (apiKey vs OAuth, {{SECRET}} references, GitHub PATs), reject $NAME API keys that name an existing secret, and point the config error at sim connector-types list --detail full.
  • Env-reference passwords: Copilot chat deploy and file share store a whole-value {{NAME}} password literally since the move to v2; it's resolved again for Copilot only, validated after resolution, and skipped when a share is being disabled.

Type of Change

  • Bug fix

Testing

Each fix has tests that fail without it. Type-check, lint, check:audits (49), block registry, and docs manifest pass; ~17k tests across the touched areas pass.

Checklist

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

…bers

Workflow file inputs can reference stored files by id, key, or internal URL,
and every resolved file is added to the run's explicit file grants. Any
caller could use this, so an anonymous public-API, public MCP, chat, or
webhook caller could pull another workflow's run files or workspace files
into a run and receive a presigned URL for them.

Execution now derives a stored-file reference scope from the run's
principal: authorized member principals (session, personal/workspace API
key, OAuth token, delegated) resolve workspace-wide; system principals may
only reference files already stored under the current execution, which keeps
chat and webhook uploads working. The default is the restricted scope, so a
new caller fails closed. Input-format defaults are workflow-authored and
still resolve workspace-wide.

Outside workspace scope, an upload whose URL is an internal file URL is
resolved as the stored reference it names rather than downloaded with the
run user's access, and a key from another execution is refused before it is
looked up, so the refusal does not reveal whether the file exists.
…ults

Table rows read through sim_cli reached the model without their persisted
secret provenance, so stored secrets in cells were never redacted. Row use
cases now report the provenance of the rows they return to an observing
transport (mirroring the workspace-file delivery observer), and the agent CLI
table transport imports it into the tool call's registry, answers 503 without
a registry, and marks the registry incomplete when a row-bearing table route
returns without reporting provenance. Provenance reported by detached work
after the call settles is ignored.

Export download links are refused outright: a signed link to the whole table
as plaintext CSV cannot carry provenance once fetched.

Run-state and enrichment error text (runState.error, blockErrors, enrichment
provider errors) is captured from executor output without its secret
provenance, so a read that returns any of it is withheld as well; reads whose
run state carries no error text are unaffected.
PR #8208 widened Google Calendar's domain-wide delegation scopes to include
calendar.readonly for every service-account token. Google refuses the whole
token exchange when any requested scope is not authorized for the client, so
indexed admin-mode Calendar syncs configured for calendar.events.readonly
failed every run and were eventually disabled.

Live service search only needed the wider scope to read an all-day event's
calendar time zone. events.list returns the calendar's timeZone under
calendar.events.readonly, so live search now reads it there and delegates with
the same single scope as the indexed crawl, matching Drive and Gmail. The admin
calendar picker keeps its own calendar.readonly request, as documented.
…loy and file share

Copilot now deploys chats and shares files through the v2 API, which stored a
whole-value {{NAME}} password literally (or 400'd a short one on length). The
application use cases now resolve the reference from the effective environment
when, and only when, the caller is an admitted Copilot workspace invocation and
the password will actually be stored (password mode; for a file share, only
while enabling it), refuse an unset variable by name, and hold the resolved
value to the password rules. Every other principal keeps literal semantics.

The v2 password fields admit a whole-value reference below the password
minimum as one refined string (not a union, which would make the CLI flag
JSON-only), still capped at the password maximum; the use cases enforce the
15-character rule on the value actually stored. Connector API-key references
share the same principal environment lookup, and the exact reference regex now
lives in one module.

Unlike the removed Copilot tool path, the resolved password is not recorded in
a resolved-secret trace registry: the v2 use case has none, and the password
is write-only and never echoed back.
@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Sep 23, 2026 11:56pm 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.

All reported issues were addressed across 58 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/google-service.ts
Comment thread apps/sim/hooks/queries/kb/knowledge.ts
@greptile-apps

greptile-apps Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no actionable blocking defects identified.

Summary

This PR addresses v1.0.0 regressions in workflow file inputs, Copilot table reads, Calendar delegation, search transitions, and secret-reference handling.

  • Restricts caller-supplied stored-file references according to the execution principal while preserving workflow-authored defaults.
  • Connects table-row provenance to CLI result redaction and withholds unsupported table results and export-download links.
  • Restores events-only Calendar delegation, page-owned search-result retention, and the resource activity-dot color.
  • Restores Copilot password-reference resolution and updates connector authentication guidance.

No actionable defects were established in the reviewed changes. Tests were inspected but not executed during this review.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Copilot CLI table request] --> B{Route classification}
  B -->|Metadata-only route| C[Existing transport]
  B -->|Export download| D[Reject download link]
  B -->|Row-bearing route| E[Observe authorized row delivery]
  E --> F[Load persisted row provenance]
  F --> G[Import provenance into result registry]
  G --> H{Complete provenance and no untracked error text?}
  H -->|Yes| I[Redact model-facing result]
  H -->|No| J[Withhold model-facing content]
Loading

Reviews (1) · Last reviewed commit: "fix(mothership): resolve Copilot env-ref..."

@waleedlatif1
waleedlatif1 merged commit e919e4c into staging Sep 24, 2026
34 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/mothership-revamp-regressions branch September 24, 2026 00:53

This branch was successfully deployed

1 active deployment
Preview 55e657f2 Deployed Sep 23, 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