backnotprop / backnotprop/plannotator

Plan review re-opens for a plan already decided in the same session

Open
#1,075 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.7k
Forks
649
Avg merge
11h 12m
Merged PRs (30d)
109

Description

## Summary

A plan review re-opens for a plan that was already decided, in two situations. Both reproduce on `main` (`56df64c7`, v0.23.1), run from source.

## Case 1 — `ExitPlanMode`: identical plan submitted twice opens two reviews

```bash
EVENT='{"tool_name":"ExitPlanMode","session_id":"sess-abc","tool_input":{"plan":"# Add caching layer\n\n- add redis client\n- wire cache into handler\n"}}'
echo "$EVENT" | plannotator # review opens -> approve it
echo "$EVENT" | plannotator # a second review opens for the identical plan
```

Observed: two separate review servers/sessions. There is no dedup on this path — the plan text is read straight from `event.tool_input.plan` and handed to `startPlannotatorServer`.

## Case 2 — Codex `Stop`: a bookkeeping-only turn re-opens the previous turn's plan

The `Stop` hook fires at the end of every turn and scrapes the transcript for the latest plan. If the next turn doesn't propose a new plan (e.g. the agent only wrote a file or recorded a decision), the previously-approved plan is still the latest one in the transcript, so it gets reviewed again.

Repro: send a `Stop` event whose rollout contains a `` block, approve it, append a non-plan assistant message to the rollout, then send a second `Stop` event with a new `turn_id`. A second review opens for the same plan.

`getLatestCodexPlan` does guard against this, but only *within* a turn — it requires `stop_hook_active` and a `

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.