Skip to content

feat(plan): Send stale open plan items back to the model - #3771

Merged
BYK merged 1 commit into
mainfrom
feat/plan-review-nudge
Nov 20, 2026
Merged

BYK merged 1 commit into
mainfrom
feat/plan-review-nudge

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Plan items go stale: the model adds them, finishes the work in a later Turn, and never closes them. Nothing in a Turn shows the model its open items again unless a person changes one (<plan-delta>) or compaction runs (<plan>), so a backlog from the morning is still "open" at night.

This adds a turn-based review, the TTL nudge that @thomasjiangcy suggested:

  • When history has not shown the plan for 3 inputs (no successful updatePlan result, no <plan>, no <plan-delta>), the next Turn context gets a <plan> block with every open item: "These items of your plan are still open. Close each one whose work ended."
  • The review is itself a plan block, so it resets the counter. It comes back only after 3 more inputs without a plan change, so it cannot loop and costs no extra model call.
  • A <plan-delta> wins over a review in the same Turn, since it also resets the counter.
  • An input is a user message other than a Turn context (a prompt, steering, an agent result). Short Conversations with a fresh plan get no review.
  • The planning rule now says to close an item in the Turn that its work ends (child result, merged PR), and that <plan> also shows up when the plan has not changed for a few Turns.
  • TurnContextPromptInput.planDelta is renamed to plan, since it now carries either block.

Open decision: why not prompt at the end of the work? For root and Thread Turns (not gated), the final text is delivered to Slack when the model emits it. A reminder after that boundary would need a second model call that either posts a second message or runs with delivery suppressed and tools limited to updatePlan. It would also change which assistant message is the Turn's last one, which other code reads. The review at the next Turn start avoids all of that. A gated-Turn-only end-of-work reminder (Tasks, Automations, where the answer is a reply tool call) could follow if the review is not enough.

The interval (3 inputs) is a guess. No eval covers whether the model actually closes items from the review yet.

via @BYK.

--

View Session [Sentry]

The model often forgets to close plan items after their work ends, so the
plan goes stale. When history has not shown the plan for three inputs, the
next Turn context gets a <plan> block with every open item and asks the
model to close each one whose work ended. The block is itself a plan
block, so the review waits for the next interval and cannot loop.

Co-Authored-By: Burak Yigit Kaya <[email protected]>
@vercel

vercel Bot commented Nov 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 19, 2026 1:04pm UTC

Request Review

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

7 screenshot changes — 7 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Skill Editor · Desktop
Automation Skill Editor · Desktop
Changed
Automations Runs Filters · Desktop
Automations Runs Filters · Desktop
Changed
Conversation Event Log · Mobile
Conversation Event Log · Mobile
Changed
Conversation Question · Desktop
Conversation Question · Desktop
Changed
Conversation Question Answered · Desktop
Conversation Question Answered · Desktop
Changed
Conversation Question Light · Desktop
Conversation Question Light · Desktop
Changed
Show 1 more changed screenshot
System Cache Warming · Desktop
System Cache Warming · Desktop
Changed

@BYK BYK closed this Nov 20, 2026
@BYK BYK reopened this Nov 20, 2026
@BYK
BYK marked this pull request as ready for review November 20, 2026 19:13
@sentry-junior
sentry-junior Bot requested a review from BYK November 20, 2026 19:13
@BYK
BYK enabled auto-merge (squash) November 20, 2026 19:13
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 20, 2026
@BYK
BYK merged commit 018bd4d into main Nov 20, 2026
98 of 104 checks passed
@BYK
BYK deleted the feat/plan-review-nudge branch November 20, 2026 19:24
BYK pushed a commit that referenced this pull request Nov 20, 2026
#3852 (merged 2026-11-20 09:50:55 UTC) changed Plan item
ids in model-read text from `#<n>` to `TODO-<n>`. #3771
(merged 2026-11-20 19:24:08 UTC) was written before that change and
expects the old `#<n>` format for the open plan items review.

This changes that expectation to `TODO-<n>`, the format the rest of the
file already uses.

<!-- junior-request-attribution:start -->
via **andrew**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3Ae1b013079cd0f736421b3bbf -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3Ae1b013079cd0f736421b3bbf)
[[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3Ae1b013079cd0f736421b3bbf/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: andrew <[email protected]>
BYK added a commit that referenced this pull request Nov 21, 2026
Junior's Plan is used as a to-do list, but it has five statuses and a
one-in-progress-per-assignee rule. `pending` and `blocked` both mean the
work is still open, and the rule makes the agent shuffle statuses before
it can start a second item. This PR makes it a To-do list with four
statuses and renames Plan and Plan item to **To-do** everywhere, in one
hard cutover.

- **Statuses:** `open`, `in_progress`, `done`, `dropped`. Migration
`0143_todos` renames the table, sequence, and constraints (data stays),
keeps `in_progress`, maps `pending`/`blocked` to `open` and `cancelled`
to `dropped`, and drops the one-in-progress-per-assignee unique index.
- **Tool:** `updateTodos` replaces `updatePlan`, with the same add,
update, remove, delta, and `replaced_person_changes`. The model sees and
passes To-do ids as `TODO-<n>` (from #3852); storage, the REST API, and
the dashboard keep numeric ids.
- **Prompt:** `<todos>` and `<todo-delta>` replace `<plan>` and
`<plan-delta>`. The rules section is `<todo-policy>`. It asks the agent
to set `in_progress` when work starts and `done` or `dropped` in the
Turn that the work ends, and to keep `TODO-<n>` ids out of replies.
- **Stale To-do review (from #3771):** when history has not shown the
To-dos for 3 inputs (no successful `updateTodos` result, no `<todos>`,
no `<todo-delta>`), the next Turn context gets a `<todos>` block with
every open To-do: "These To-dos are still open. Close each one whose
work ended." The Turn-context field is `todos`; a `<todo-delta>` wins
over a review.
- **API and dashboard:** `/api/conversations/:id/todos` replaces
`/plan`. The card is "To-dos", with Start / Mark done / Stop / Drop /
Reopen.

**What breaks:** code from before this PR cannot read the renamed table,
so roll forward instead of rolling back the deploy. The `/plan` routes
are gone; only the dashboard used them.

| | Desktop | Mobile |
| --- | --- | --- |
| Light | ![To-dos, light,
desktop](https://junior-prod.sentry.dev/public/artifacts/4f6f1548-969f-4626-af73-61d4b1dda788.png)
| ![To-dos, light,
mobile](https://junior-prod.sentry.dev/public/artifacts/16d16e17-3da2-49dc-a1e2-07df3cf6081f.png)
|
| Dark | ![To-dos, dark,
desktop](https://junior-prod.sentry.dev/public/artifacts/926a3522-824d-4906-8436-73005551faf4.png)
| ![To-dos, dark,
mobile](https://junior-prod.sentry.dev/public/artifacts/93796c24-4780-42b8-a2a0-fab5ab219ec2.png)
|

Status menu on an in-progress To-do:

![To-do status menu, dark,
desktop](https://junior-prod.sentry.dev/public/artifacts/4ad55aca-826d-48e7-83d0-72a4e6f13efd.png)

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ab532e61f522b672af8b9e6e0d710a06f -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ab532e61f522b672af8b9e6e0d710a06f)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ab532e61f522b672af8b9e6e0d710a06f/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 447a1c13 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant