Skip to content

fix: restore assistant handoff after late background results - #44

Merged
johoja12 merged 1 commit into
localfrom
fix/42-background-handoff
Nov 3, 2026
Merged

johoja12 merged 1 commit into
localfrom
fix/42-background-handoff

Conversation

@johoja12

@johoja12 johoja12 commented Nov 3, 2026

Copy link
Copy Markdown
Owner

After #43 fixed observation of older background commands, live deployment verification found Home could still fail handoff: the background command from its completed turn finished afterward, so the readiness detector treated that late result as an unfinished native turn.

Recognize a completed conversation as idle when subsequent native events are only command completions from that same turn or a demonstrably older UUIDv7 turn in the bound conversation. Later task starts, user messages, foreign conversations, newer turns and missing identities still prevent handoff. Keep strict parsing and completion evidence; do not stop or replay background work.

Follow-up for #42 and #43. Local request/recovery suite: 66 tests pass, including seven new handoff cases. The deployment candidate correctly recognizes Home's full real transcript as ready and its exact request as completed, while preserving already-deployed unrelated assistant parser/recovery changes. Existing shared WIP remains separate.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 77d591a5-9c6d-4540-9976-f47f12bf7178

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@johoja12
johoja12 merged commit 67d8403 into local Nov 3, 2026
3 checks passed
@johoja12

johoja12 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Implemented and deployed through merged fork PRs #43 and #44. origin/local and the shared local checkout now match 67d8403f11880438e84f9cd63d4ad21da7c5f294.

Two related causes were fixed:

  1. A same-conversation command completion from an older UUIDv7 turn falsely poisoned the current request as Transcript identity changed.
  2. A background command completion arriving AFTER its own turn completed caused the readiness detector to refuse handoff as unfinished work.

Only scoped background command events are ignored/recognized. Other conversations, newer or ambiguous turn IDs, user-message events and actual new task starts still fail closed. No task was replayed, no background command stopped, and no uncertain result relabeled as successful in the durable ledger.

Validation: 66 request/recovery tests passed on the clean feature branch; 70 passed with the existing deployed assistant changes included. Typecheck, lint, formatting, lockfile, frontend syntax, public assets and all pre-push static gates passed. The actual incident transcript projects as completed for the exact request turn, and its full conversation is now ready despite the trailing background result.

Production deployment at 2026-11-03 15:26:25 Asia/Dubai: installed only the verified observer/request-manager JS modules and source maps, preserving the already-deployed uncommitted parser/recovery behavior and all unrelated frontend artifacts. Restarted codeman-web, verified active PID 2257731 and HTTP 200. Restored both assistants via the supported handoff API. Fresh Home and Brain API results: requestExecution=true, handedOff=true, needsAttention=false, recovery armed, attempts 0. Session bindings were preserved. Existing five shared WIP files remain uncommitted; no stash was created or consumed.

GitHub CI for #44 was still in progress when this deployment verification completed; local passing checks are not a claim that remote CI has finished.

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.

1 participant