Skip to content

Improve experimental message editing - #1378

Merged
ymichael merged 9 commits into
mainfrom
bb/fix-experimental-message-editing-error-thr_ntd244wr3q
Aug 12, 2026
Merged

ymichael merged 9 commits into
mainfrom
bb/fix-experimental-message-editing-error-thr_ntd244wr3q

Conversation

@ymichael

@ymichael ymichael commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • edit accepted root user messages regardless of whether the selected turn completed, failed, was interrupted, or has no completion event
  • stop a running thread on edit submission, wait for lifecycle settlement, then re-resolve the exact selected request before rewriting history
  • preserve the Pi provider checkpoint produced by an aborted turn through the runtime, host daemon, and synthetic interrupted completion
  • keep edit actions available while a supported thread is active
  • allow rewinds when the preceding provider turn ended as interrupted
  • close an in-progress message editor immediately instead of showing a discard-confirmation toast
  • update CLI help, guides, experiment documentation, and the built-in bb-cli skill for the expanded behavior

Testing

  • pnpm exec turbo run test --filter=@bb/server --force -- test/threads/thread-edit-message.test.ts test/threads/thread-stop-retry.test.ts test/threads/thread-live-start-handoff.test.ts (48 tests, including all 15 provider/status combinations)
  • pnpm exec turbo run test --filter=@bb/agent-runtime --force -- src/pi/bridge/__tests__/bridge.test.ts src/pi/bridge/__tests__/sdk-session.test.ts src/runtime.command-contract.test.ts (74 tests)
  • pnpm exec turbo run test --filter=@bb/agent-runtime --force -- src/runtime-thread-rewind.test.ts src/codex/adapter.test.ts src/pi/adapter.test.ts src/claude-code/adapter.test.ts src/pi/bridge/__tests__/bridge.test.ts src/claude-code/bridge/__tests__/bridge.test.ts (475 tests)
  • pnpm exec turbo run test --filter=@bb/host-daemon --force (542 tests)
  • pnpm exec turbo run test --filter=@bb/host-daemon-contract --force (49 tests)
  • pnpm exec turbo run test --filter=@bb/app --force (336 files, 2,551 tests)
  • pnpm exec turbo run typecheck --filter=@bb/agent-runtime --filter=@bb/host-daemon --filter=@bb/host-daemon-contract --filter=@bb/server
  • pnpm exec turbo run typecheck --filter=@bb/app --filter=@bb/cli --filter=@bb/server-contract --filter=@bb/templates
  • pnpm exec turbo run lint --filter=@bb/agent-runtime --filter=@bb/host-daemon --filter=@bb/host-daemon-contract --filter=@bb/server
  • pnpm exec turbo run lint --filter=@bb/app --filter=@bb/cli (0 errors, existing warnings only)
  • pnpm exec prettier --check ...
  • node packages/templates/scripts/generate-templates.mjs --check
  • git diff --check

AGENT GENERATED: by GPT-5.6 Codex

@SawyerHood

SawyerHood commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

🚨 SLOP COP 🚨 · review

I am the SlopCop. I am reviewing this pull request under the review rule.

I will run security, code quality, architecture, performance, and end-to-end checks. I will post one final review after the checks finish.

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

ELI5: A stopped Codex turn no longer blocks edits to the next message. It is like reopening a book after a pause.

I found one concern. The new condition also accepts failed prior turns. Failed Claude Code turns can carry checkpoints with incomplete provider state. The pull request states only interrupted prior turns. I left an inline comment on the condition.

The security review found no vulnerability. The change keeps the authorization checks, write gates, transaction checks, and fail-closed rewind order.

The performance review found no regression. The change adds no query, loop, index, or event scan.

The architecture review found no duplicate checkpoint policy or stale domain name. This service remains the single policy location.

The end-to-end browser check passed. I stopped a real Codex turn, completed a second turn, edited the second user message, and received the expected edited reply.

Validation passed:

  • All 23 focused server tests passed.
  • All 1,437 server tests passed.
  • The server typecheck and git diff --check passed.
  • All GitHub checks passed.

I posted this as a comment-only review. I did not approve the pull request or request changes.

@ymichael ymichael changed the title Allow message edits after interrupted turns Improve experimental message editing Aug 12, 2026
@ymichael
ymichael force-pushed the bb/fix-experimental-message-editing-error-thr_ntd244wr3q branch from 7f9858d to 854cf39 Compare August 12, 2026 16:53
@ymichael
ymichael merged commit 9eed2ac into main Aug 12, 2026
10 checks passed
@ymichael
ymichael deleted the bb/fix-experimental-message-editing-error-thr_ntd244wr3q branch August 12, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants