Skip to content

fix(copilot): require approval for terminal input, which can submit a command line - #9575

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/terminal-input-approval-gate
Nov 2, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/terminal-input-approval-gate

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The terminal tool's approval gate only held run. input went through ungated, and on a tmux-attached terminal the desktop types it into the pane's shell prompt and presses Enter, so an input call could run a command line with no approval card
  • terminalOperationNeedsApproval now gates every operation except an explicit allowlist that never delivers keystrokes (read, list, cwd, panes, new, switch, close, kill, handoff) — the same set that was ungated before, minus input
  • Fails closed: an unknown or missing operation, or one added to the protocol later, is gated until someone deliberately allowlists it
  • Keys-only input is gated too: up + enter re-runs the last shell command. Interrupting stays ungated through kill
  • Gate stays server-side on the persisted row, so it binds every shipped desktop build without an app update

Type of Change

  • Bug fix

Testing

  • New cases in permission.test.ts (typed-text input, keys-only input, unknown operation, missing operation) fail on the pre-fix code and pass after
  • lib/mothership/request/tools/ + lib/mothership/request/handlers/ suites: 362/362 passing
  • bun run lint clean
  • Checked side effects: the desktop's quick-op timeout and the renderer's client start both begin only after approval, so a gated input does not time out while the card waits; the approval card's tooltip shows the full args, including the text to be typed

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)

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 2, 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 Nov 2, 2026 8:33pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Terminal input now requires approval, including keys-only calls. Unknown or missing operations also require approval.

  • Terminal input now waits for approval before the desktop can send it.

Reviews (2) · Last reviewed commit: "fix(copilot): claim an ungated terminal ..." · Reviewed by Greptile

@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 2 files

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

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

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

@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 3 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

@waleedlatif1
waleedlatif1 merged commit 868f201 into staging Nov 2, 2026
72 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/terminal-input-approval-gate branch November 2, 2026 23:26

This branch was previously deployed

1 inactive deployment
Preview — a01d0288 Deployed Nov 2, 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