You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
revdiff-planning: Codex Stop hook never reviews plans because Plan mode is not reported in permission_mode #398
With revdiff-planning 0.3.10 installed in Codex and its Stop hook trusted in /hooks, a plan produced in Plan mode is never opened in revdiff. Codex shows its normal "Implement this plan?" prompt, and no overlay, warning or plan-rev-* snapshot appears.
I logged the Stop payload Codex sends for that Plan-mode turn:
codex-plan-review-hook.py returns {} unless permission_mode == "plan", so it exits before reading the plan. In Codex, permission_mode carries the approval policy, not the collaboration mode. #267 noted the same on 0.144.4 (bypassPermissions in a Plan-mode session, "so it cannot gate Plan mode"), but the gate in #268 still checks permission_mode. With the default approval policy the automatic review therefore never runs.
The transcript of the same turn does record the mode:
It also contains the complete <proposed_plan> that the existing transcript fallback already finds.
Environment: macOS, Codex CLI 0.163.0, revdiff v1.13.0, revdiff-planning 0.3.10, agterm 0.36.0. Claude Code with the same plugin works as documented.
How does this solve it?
Proposal: treat a turn as Plan mode when permission_mode == "plan" (current behavior kept) or when the transcript's task_started event for the event's turn_id has collaboration_mode_kind == "plan". The transcript is located with the same checks the fallback already uses: the transcript_path filename must contain session_id. When the transcript is missing or does not match, the hook still skips the turn, so Build/default responses that quote <proposed_plan> stay ignored.
This fixes the root cause: the hook reads the mode from the only place Codex currently records it, instead of from the approval policy. It adds no new dependency and reuses the existing transcript contract, which the plugin already treats as best-effort and fail-open.
A local check confirms that reading collaboration_mode_kind makes the review run.
Activity
fix(plugins): detect Codex Plan mode from the transcript (umputun#399)