Skip to content

Expose bypass clear reminder permission mode#668

Merged
backnotprop merged 5 commits intobacknotprop:mainfrom
AgileInnov8tor:feature/bypass-clear-permission-mode
May 5, 2026
Merged

Expose bypass clear reminder permission mode#668
backnotprop merged 5 commits intobacknotprop:mainfrom
AgileInnov8tor:feature/bypass-clear-permission-mode

Conversation

@AgileInnov8tor
Copy link
Copy Markdown
Contributor

Summary

  • Adds a synthetic persisted bypassPermissionsClearReminder permission mode for Settings and first-run setup.
  • Decomposes that UI mode to Claude Code wire fields: permissionMode: 'bypassPermissions' plus clearContextNudge: true.
  • Validates stored permission-mode cookie values before reusing them.

Test Plan

  • bun test packages/editor/approvalBody.test.ts
  • bun run --cwd apps/review build && bun run build:hook
  • bun run --cwd packages/ui typecheck
  • PATH="$PWD/packages/ui/node_modules/.bin:$PATH" bun run typecheck
  • bun test
  • git diff --check c7727b9..HEAD

Notes

  • Direct push to backnotprop/plannotator was denied for the authenticated accounts, so this PR is opened from the AgileInnov8tor/plannotator fork.

AgileInnov8tor and others added 5 commits May 5, 2026 15:05
Thread a clear-context reminder flag through approval decisions, expose a Claude Code-only approval entry that requests bypass mode, and keep the hook response honest by emitting a reminder instead of claiming context was cleared.

Constraint: Claude Code PermissionRequest hooks have no documented clearContext response field and bypassPermissions is only a request when the mode is available.

Rejected: adding a permission-mode enum or undocumented clearContext field | those would misrepresent hook capabilities and broaden the contract.

Confidence: high

Scope-risk: moderate

Directive: Do not claim Plannotator clears context until Claude Code documents a hook field for that behavior; keep reminder copy truthful.

Tested: bun test packages/server apps/hook; bun test packages/editor/wideMode.test.ts packages/ui/hooks/useAgentSettings.test.ts; bun test; bun run build:review; bun run build:hook; bun run typecheck; git diff --check --cached.

Not-tested: Browser warning-dialog replay and interactive Claude Code smoke test.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Constraint: Claude Code hooks cannot clear context directly; the new action remains a truthful reminder plus bypass-mode approval.
Rejected: Sending OpenCode agent-switch state for Claude Code | it leaked build (?) UI state and misleading payload fields.
Confidence: high
Scope-risk: narrow
Directive: Keep OpenCode agent switching gated to opencode-origin approval payloads.
Tested: bun run typecheck; bun test; bun run build:review; bun run build:hook
Not-tested: Manual browser click-through of the Claude Code dropdown.
Constraint: Claude Code hooks can only emit a systemMessage nudge, not clear context directly.

Rejected: Server protocol changes | existing permissionMode plus clearContextNudge wire fields already support the behavior.

Confidence: high

Scope-risk: narrow

Directive: Keep bypassPermissionsClearReminder as a UI/storage-only synthetic mode that decomposes before /api/approve.

Tested: bun test packages/editor/approvalBody.test.ts; bun run --cwd apps/review build && bun run build:hook; bun run --cwd packages/ui typecheck; git diff --check

Not-tested: Root bun run typecheck could not run because tsc was not on PATH for the root script.
Constraint: Stored browser values can be stale, corrupt, or from a future Plannotator build.

Rejected: Trusting the storage read with a type assertion | invalid values could flow into UI state and approval request construction.

Confidence: high

Scope-risk: narrow

Directive: Keep PermissionMode storage reads validated against PERMISSION_MODE_OPTIONS when adding or renaming modes.

Tested: bun test packages/editor/approvalBody.test.ts; bun run --cwd packages/ui typecheck; git diff --check

Not-tested: Full repo typecheck/build, outside this review-fix scope.
Settings persisted permission mode changes, but App kept the original mode in React state and used that stale value when building approval payloads. Push the Settings change back into App so the selected clear-reminder mode reaches the hook decision.

Constraint: Permission mode storage is cookie-backed while approval payload construction reads App state.\nRejected: Read permission cookies during approval | would couple approval construction to browser storage and duplicate Settings state.\nConfidence: high\nScope-risk: narrow\nDirective: Keep permission-mode writes synchronized with approval state when adding or changing modes.\nTested: bun test packages/editor/approvalBody.test.ts packages/ui/components/ApproveDropdown.test.tsx; bun x tsc --noEmit -p packages/ui/tsconfig.json; bun run build:hook; direct Playwright hook smoke verified bypassPermissionsClearReminder UI and hook payload.\nNot-tested: Live interactive Claude CLI session; direct hook/server simulation covered the wire output.
@backnotprop backnotprop merged commit 3b88415 into backnotprop:main May 5, 2026
10 checks passed
@backnotprop
Copy link
Copy Markdown
Owner

@AgileInnov8tor I accidentally merged this without review. and released it, but im reverting.

This feels like a big no-op?

The hooks dont pass any messaging at all, so neither the user or agent even see the /clear reminder?

backnotprop added a commit that referenced this pull request May 6, 2026
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.

2 participants