mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
2.6 KiB
2.6 KiB
Plan Approval Normalization
Goal
Normalize plan approval across providers so the UI renders one consistent plan approval card and action row, while each provider keeps its own execution quirks behind the session permission interface.
Compatibility Constraints
- Older clients must remain compatible with newer daemons.
- All new wire fields must be optional.
- Existing plan permissions without action metadata must still render and work.
- Existing question permissions must keep their current behavior.
Design
Shared abstraction
Add optional permission action definitions to the shared permission request/response types.
- Permission requests may include
actions. - Permission responses may include
selectedActionId. kind: "plan"remains the normalized concept for plan approval.- The UI renders actions from the permission request instead of hardcoding provider-specific buttons.
Claude
Keep Claude's plan permission flow, but enrich it with explicit action definitions.
- Always expose
Reject. - Always expose
Implement. - If the agent entered plan mode from a more permissive mode like
bypassPermissions, also exposeImplement with <previous mode>. - Resolve the selected action entirely inside
respondToPermission().
Codex
Synthesize a normalized kind: "plan" permission after a Codex plan-mode turn completes with a plan result.
- Emit a plan permission with
RejectandImplementactions. - On
Implement, disableplan_mode, disablefast_mode, and automatically start a follow-up implementation turn. - On
Reject, resolve without starting a follow-up turn. - Keep the implementation prompt and state transitions inside the Codex provider.
Manager and state sync
After permission resolution, refresh provider-derived state so the UI sees internal mode/feature changes without knowing provider quirks.
- Refresh current mode
- Refresh pending permissions
- Refresh runtime info
- Refresh features
- Persist refreshed state
UI
Render plan permissions through the existing plan card, but generate buttons from normalized permission actions.
- If
actionsare absent, fall back to legacy buttons. - Plan cards should use
Implementas the default primary label. - Do not add provider-specific rendering branches.
Verification
- Shared schema/type tests for optional
actionsandselectedActionId - App tests for generic plan-action rendering
- Claude tests for third action when resuming from a more permissive mode
- Codex tests for synthetic plan approval and automatic implementation follow-up
- Manager tests for post-permission state refresh
npm run typecheck