Skip to content

fix: clear 'Plan Ready' on implementation in a new thread#1117

Closed
UtkarshUsername wants to merge 13 commits intopingdotgg:mainfrom
UtkarshUsername:fix/clear-plan-ready-on-new-thread-implementation
Closed

fix: clear 'Plan Ready' on implementation in a new thread#1117
UtkarshUsername wants to merge 13 commits intopingdotgg:mainfrom
UtkarshUsername:fix/clear-plan-ready-on-new-thread-implementation

Conversation

@UtkarshUsername
Copy link
Contributor

@UtkarshUsername UtkarshUsername commented Mar 15, 2026

You can view my issues and PRs at https://pr-navigator.pages.dev/t3code-utkarsh.

What Changed

This fixes the stale Plan Ready state when a proposed plan is implemented via Implement in new thread.

On the backend side, proposed plans now carry implementation metadata, thread.turn.start can reference a source proposed plan, the decider marks that source plan as implemented when the new thread starts successfully, and projections/persistence round-trip that state.

On the web side, the sidebar and chat view now treat only unimplemented proposed plans as actionable, so the source thread stops showing Plan Ready and hides the follow-up plan actions after cross-thread implementation.

Why

Before this change, same-thread implementation cleared Plan Ready because the thread left plan mode, but the “implement in new thread” flow did not consume the source plan at all. That left the original thread in a stale actionable state even after the implementation thread had already started.

The right fix is to make “implemented elsewhere” first-class domain state and have the UI consume that state, instead of patching the sidebar locally.

Partially fixes #978. Showing the link in UI can be done in another PR.

UI Changes

Posted the video on X because the file size was too large to upload here: https://x.com/UtkarshUsername/status/2033161459447087223?s=20

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included a video for animation/interaction changes

Note

Clear 'Plan Ready' status when a proposed plan is implemented in a new thread

  • Tracks implementation metadata (implementedAt, implementationThreadId) on proposed plans end-to-end: DB schema (migrations 014 and 015), contracts, projection, and frontend store.
  • When a thread.turn.start command includes a sourceProposedPlan reference, the decider validates it and carries it into the thread.turn-start-requested event; on accepted turn.started, the ingestion service marks that plan as implemented.
  • hasActionableProposedPlan helper in session-logic.ts returns false for implemented plans; resolveThreadStatusPill in Sidebar.logic.ts uses it so threads with implemented plans show 'Completed' instead of 'Plan Ready'.
  • ChatView.tsx passes sourceProposedPlan in the dispatch payload and gates the follow-up prompt on hasActionableProposedPlan.
  • Pending turn-start rows now store source plan references and are consumed FIFO (oldest first) instead of clearing all at once.

Macroscope summarized 7af5861.

@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 890b1edc-abf1-47c4-a59d-3a61e360be73

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 15, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6efed9b736

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Carry `sourceProposedPlan` metadata in `thread.turn-start-requested`
- Persist source plan thread/plan IDs on pending projection turns via migration 015
- Mark proposed plans implemented in runtime ingestion only after `turn.started`
- Update decider, contracts, and ingestion tests to match new lifecycle
@UtkarshUsername
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: daee140d7e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@UtkarshUsername UtkarshUsername marked this pull request as draft March 15, 2026 14:07
@github-actions github-actions bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Mar 15, 2026
@UtkarshUsername
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e4354bc9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions github-actions bot added size:XL 500-999 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Mar 15, 2026
@UtkarshUsername
Copy link
Contributor Author

@codex review. I hope this is the last 🤞

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4bd52fa2c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@UtkarshUsername
Copy link
Contributor Author

@codex review 😬

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86a20d1b73

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@UtkarshUsername
Copy link
Contributor Author

Ok, I am going to continue these reviews in the cli now 😫

@UtkarshUsername
Copy link
Contributor Author

All the reviews found by the cli codex review were invalid or separate PR-worthy. So, let's go!

@UtkarshUsername UtkarshUsername marked this pull request as ready for review March 15, 2026 18:01
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d7a5164f66

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- stop overwriting pending turn-start placeholders; append and consume oldest first
- handle `provider.turn.start.failed` by deleting only the oldest pending placeholder row
- extend ingestion test coverage for overlapping turn-start requests on a target thread
@github-actions github-actions bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Mar 15, 2026
@github-actions github-actions bot added size:XL 500-999 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Mar 15, 2026
@UtkarshUsername
Copy link
Contributor Author

See #1133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link planning and implementation threads when using Implement in new thread

1 participant