Skip to content

feat(run-events): symmetric auto-approve telemetry for skipPermissions (F8)#11

Closed
tesdal wants to merge 1 commit intophase-ab-basefrom
local/audit-f8-auto-approve-telemetry
Closed

feat(run-events): symmetric auto-approve telemetry for skipPermissions (F8)#11
tesdal wants to merge 1 commit intophase-ab-basefrom
local/audit-f8-auto-approve-telemetry

Conversation

@tesdal
Copy link
Copy Markdown
Owner

@tesdal tesdal commented Apr 27, 2026

Summary

Audit finding F8: skipPermissions=true silently replied "once" to every permission.asked event with no counter and no JSON event. Operators running --dangerously-skip-permissions had no audit trail of what the agent was allowed to do.

This adds symmetric autoApprovedPermissions stat and "auto-approve" JSON event mirroring the existing "auto-reject" telemetry shape.

Design notes

  • bumpApprove is intentionally separate from bump: approve count does not feed the livelock-warn threshold (operators opted into skipPermissions; conflating would create false positives).
  • No question-equivalent: questions are always auto-rejected when in our subagent lineage, never auto-approved. Code comment documents both asymmetries.
  • Stats shape change: only run-events.ts and tests reference these fields, no external consumers.

Diamond review

Verification

  • 14/14 tests pass in `test/cli/run-events.test.ts` (1 new test added)
  • `bun typecheck` clean

Base branch

Targets phase-ab-base (not dev) to keep diff scoped to this finding only. Base lags upstream dev by design — refreshed at start of each task from local/integration-v2.

This PR is review-only — Copilot feedback is iterated; PR will be closed without merge and the branch merged via `--no-ff` into the local integration branch.

…ssions

Previously skipPermissions=true silently replied 'once' to every
permission.asked event with no counter and no JSON event. Operators
running --dangerously-skip-permissions had no audit trail of what the
agent was allowed to do. Adds symmetric autoApprovedPermissions stat
and 'auto-approve' JSON event mirroring the existing 'auto-reject'
telemetry shape.

Addresses audit finding F8 (Opus diamond review, 2026-04-22).
@github-actions
Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@tesdal tesdal requested a review from Copilot April 27, 2026 17:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Addresses audit finding F8 by adding symmetric telemetry for the skipPermissions=true auto-approve path, so operators using --dangerously-skip-permissions get an explicit audit trail of auto-approved permission requests.

Changes:

  • Add autoApprovedPermissions to RunEvents stats tracking.
  • Emit a new "auto-approve" JSON telemetry event when a permission is auto-approved via skipPermissions=true.
  • Add a test asserting both the stats increment and JSON event emission for the auto-approve path.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/opencode/src/cli/cmd/run-events.ts Adds autoApprovedPermissions stat and emits "auto-approve" JSON events on the skipPermissions permission auto-approve branch.
packages/opencode/test/cli/run-events.test.ts Adds coverage verifying the new stat and JSON telemetry event are produced when skipPermissions=true and jsonMode=true.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tesdal
Copy link
Copy Markdown
Owner Author

tesdal commented Apr 27, 2026

F8 review complete. Copilot R1 clean (no comments). Diamond approved with nits applied. Merging into local/integration-v2.

@tesdal tesdal closed this Apr 27, 2026
tesdal added a commit that referenced this pull request Apr 27, 2026
PR: #11 (closed, review-only)
Diamond: codex-5.3 APPROVED_WITH_COMMENTS + Opus APPROVED_WITH_NITS (applied)
Copilot: R1 clean (no comments)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants