Skip to content

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

Draft
j15z wants to merge 1 commit into
stagingfrom
codex/agent-tool-permission-mode
Draft

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

Conversation

@j15z

@j15z j15z commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Let an agent tool's Permission Mode use a fixed selector or a variable such as <start.toolMode>. Resolve the active expression before tool filtering and reject invalid values before provider or tool work. Keep the fixed choice and expression separately, add the selector/variable toggle in the expanded tool controls, and support explicit mode selection through API/Copilot edits. Preserve the expression through workflow search and import/export. No feature flag.

Companion: simstudioai/mothership#488.

Type of Change

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

Testing

411 tests pass across nine focused suites, covering fixed/variable resolution, invalid values, secret tracking, API mode selection and unchanged round trips, import, and search. App and CLI type checks, changed-file lint, the API validation audit, and OpenAPI/CLI generated-artifact checks pass.

Existing limitations remain: API edits that reorder tools do not move their saved selector/variable modes with them, and editor reorders still save the tools and mode map separately. This change does not fix those behaviors. Earlier Chrome/CLI testing covered the feature; browser tests were not repeated for this revision.

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

@vercel

vercel Bot commented Sep 5, 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 13, 2026 12:36am 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

@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 force-pushed the codex/agent-tool-permission-mode branch from d433d88 to 68451c9 Compare September 10, 2026 00:04
@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
@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 force-pushed the codex/agent-tool-permission-mode branch from 8cfcfd4 to c3db3dc Compare September 11, 2026 17:51
@j15z
j15z changed the base branch from staging to codex/fix-api-tool-canonical-remapping September 11, 2026 17:52
@j15z
j15z force-pushed the codex/agent-tool-permission-mode branch from c3db3dc to 296302f Compare September 12, 2026 20:13
@j15z
j15z force-pushed the codex/fix-api-tool-canonical-remapping branch from b4f42b3 to 3c840ed Compare September 12, 2026 20:13
@j15z
j15z force-pushed the codex/fix-api-tool-canonical-remapping branch from 3c840ed to ea8a65c Compare September 12, 2026 20:27
@j15z
j15z force-pushed the codex/agent-tool-permission-mode branch from 296302f to 78ae7ef Compare September 12, 2026 20:27
@j15z
j15z force-pushed the codex/fix-api-tool-canonical-remapping branch from ea8a65c to 30eea7f Compare September 12, 2026 23:04
@j15z
j15z force-pushed the codex/agent-tool-permission-mode branch from 78ae7ef to c09d0d5 Compare September 12, 2026 23:04
@j15z
j15z force-pushed the codex/fix-api-tool-canonical-remapping branch from 30eea7f to b2a8afd Compare September 12, 2026 23:29
@j15z
j15z force-pushed the codex/agent-tool-permission-mode branch from c09d0d5 to 43481a7 Compare September 12, 2026 23:29
@j15z
j15z force-pushed the codex/agent-tool-permission-mode branch from 43481a7 to ed511a8 Compare September 13, 2026 00:34
@j15z
j15z changed the base branch from codex/fix-api-tool-canonical-remapping to staging September 13, 2026 00:34
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