Skip to content

feat(agent): allow variable tool permission modes - #7538

Draft
j15z wants to merge 11 commits into
stagingfrom
codex/agent-tool-permission-mode
Draft

feat(agent): allow variable tool permission modes#7538
j15z wants to merge 11 commits into
stagingfrom
codex/agent-tool-permission-mode

Conversation

@j15z

@j15z j15z commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Let each agent tool's Permission Mode use a fixed selector or a variable such as <start.toolMode>. Resolve variables before filtering tools and reject invalid modes before calling the provider.
  • Put Permission Mode in the expanded tool parameters with the canonical arrow toggle. Make both modes available without a feature flag across the editor, API/CLI, Copilot, and imports.
  • Preserve the fixed choice, variable input, and active mode through search, export/import, and tool-array changes. Save reordered tools and their mode indexes in one collaborative operation.
  • Keep disabled tools out of discovery/execution, preserve secret tracking during resolution, and retain locked-block protections. Keep saves to each subblock ordered while newer edits coalesce, and compare search replacements independently of object key order.
  • Report interrupted CLI responses with guidance for uncertain writes, and show import failures in the editor.

Companion: simstudioai/mothership#488

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • After syncing with staging: 471 focused application regression tests and all 393 realtime tests pass. Coverage includes fixed/variable resolution, invalid values, secret provenance, API/Copilot edits and dry runs, imports, search, atomic reordering, locked containers, and edits arriving during pending or failed database writes.
  • Realtime regressions stall an older workflow lookup and verify save/confirmation order, coalescing, recovery after a failed save, and independent saves to other subblocks.
  • App, realtime, and CLI type checks, repository lint, all 46 audits, API validation, block-registry, and docs-manifest checks pass. Regenerated committed artifacts and verified the removed flag and policy endpoint have no remaining source references.
  • Earlier Chrome/CLI/API testing covered Auto/Force/None, all five tool shapes, dynamic inputs, workflow variables, secrets, empty lists, reload, cross-tab editing, deployed/draft isolation, rollback, and 100-tool reversal/deletion.
  • Earlier fault testing covered scoped scheduled-job execution/recovery, dropped requests and responses around commits, injected 503s, tool cancellation, and recovery after a failed tool call.
  • Full CLI suite passed 1,032 tests with one skip under Node 24, matching CI. Interrupted-response coverage verifies retained HTTP status/error codes, cancellation, timeouts, and guidance for uncertain writes.

Remaining coverage: the latest staging merge has automated coverage but was not rerun in Chrome. Undo/redo, additional collaborative/network interleavings, viewer-account behavior, live LLM-provider outage injection, global cron ticks, and queue transport remain unverified. The existing multi-request importer is not transactional for arbitrary network failures.

Review focus: keeping each tool's permission attached through array edits, excluding disabled tools from discovery/execution, and preserving both selector and variable inputs across workflow operations.

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)

Screenshots/Videos

No screenshots or videos attached.

@vercel

vercel Bot commented Sep 5, 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 Sep 10, 2026 5:26pm UTC

Request Review

@j15z

j15z commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the previously reported per-subblock ordering race is fixed and no new actionable failures remain.

Summary

  • Resolves variable permission expressions before tool filtering and rejects invalid resolved modes.
  • Preserves tool permission settings and canonical mode indexes across array edits and workflow transformations.
  • Excludes disabled tools from discovery and execution.
  • Makes reordered tool arrays and their canonical modes a single collaborative persistence operation.
  • Improves realtime save ordering, import error reporting, and interrupted CLI response guidance.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Editor[Workflow editor] --> Stored[Stored tool configuration]
  Stored --> Fixed{Permission mode}
  Fixed -->|Basic| Selector[Fixed auto / force / none]
  Fixed -->|Advanced| Resolver[Resolve variable expression]
  Resolver --> Validate[Validate resolved mode]
  Selector --> Filter[Filter disabled tools]
  Validate --> Filter
  Filter --> Provider[Provider tool request]
  Editor --> Realtime[Realtime collaboration]
  Realtime --> Queue[Per-subblock serialized flush]
  Queue --> DB[(Workflow persistence)]
Loading

Reviews (9) · Last reviewed commit: "fix(realtime): keep debounced subblock s..."

Comment thread apps/sim/lib/workflows/tool-input/usage-control.server.ts Outdated
@j15z
j15z force-pushed the codex/agent-tool-permission-mode branch from 11c3d58 to 818dca4 Compare September 6, 2026 00:21
@j15z
j15z changed the base branch from codex/canonical-tool-mode-base to staging September 6, 2026 00:22
@j15z
j15z force-pushed the codex/agent-tool-permission-mode branch from 818dca4 to 41af1d3 Compare September 7, 2026 19:00
@j15z
j15z force-pushed the codex/agent-tool-permission-mode branch from 41af1d3 to 661f655 Compare September 9, 2026 20:30
@github-actions github-actions Bot added the requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

⚠️ Cross-repo companion check

One or more companion PRs aren't merged into staging yet. Merging this without them will leave copilot and sim out of sync — merge them in lockstep.

  • simstudioai/mothership#488OPEN, not merged (targets staging) — feat(workflow): document variable agent tool permissions

@j15z

j15z commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

Comment thread apps/realtime/src/database/operations.ts Outdated
Comment thread apps/realtime/src/database/workflow-authoring.ts Outdated
@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

Comment thread apps/sim/lib/workflows/persistence/utils.ts
Comment thread packages/workflow-types/src/agent-tool-permissions.ts Outdated
@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

Preserve the new MCP operation policy editor and runtime pipeline alongside
canonical tool permissions. Keep structured response-read failures and
interrupted-write guidance together in the CLI.
@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

Comment thread apps/realtime/src/handlers/subblocks.ts Outdated
Allow one flush per subblock while newer edits coalesce in a separate
pending batch. Start the next ready batch after the active save completes,
including failures, so a slow older lookup cannot overwrite a newer edit.

Cover delayed lookups, coalescing, failure recovery, confirmation order,
and independent subblock saves with regression tests.
@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant