Skip to content

bug: late background completion blocks Home assistant with false transcript identity mismatch #42

Closed

Description

@johoja12

Home was alive and idle in production but unable to accept messaging requests. Request e7e7a705-06b0-46ec-baf4-bd16ed8af8e3 became outcome_unknown with reason Transcript identity changed, causing recovery to block for review.

Evidence:

  • Home session 57b5da9b-128d-488a-8b09-0b4e7b1a96ae, conversation 01a115cc-a317-7910-8d73-cf3cd969fc26.
  • New request turn 01a1a0ff-0bd4-71b2-b26f-33504a365079 began normally and completed at 2026-11-03T10:50:28.642Z with a final answer.
  • At 2026-11-03T10:42:05.820Z, an item_completed / CommandExecution event from older turn 01a1a070-9999-70a1-b838-7e4162d35c0f arrived in the same conversation while the new turn was active.
  • observeAssistantTurn rejects ANY item with a different turn ID, so a late background completion permanently poisons the current request observation.
  • Transcript file inode/device still match the captured request identity. This is event attribution, not a proven file replacement.

Operational recovery completed using supported APIs: verify exact current turn completion and idle composer; take control; reconcile uncertain request without replay; enable Home; hand off. Fresh API confirms requestExecution=true, handedOff=true, needsAttention=false, recovery armed, attempts 0. Existing background work was not stopped. Production service was not restarted.

Proposed scoped fix: attribute item completions to their native turn and ignore demonstrably unrelated earlier-turn background completions while preserving fail-closed behavior for changed conversation IDs, actual concurrent new turns, malformed records, and ambiguous/missing identity. Add a regression fixture with an older background command completing during the current turn, including completion/side-effect safety checks. Existing unrelated assistant WIP in the shared checkout must be preserved.

Activity

  1. johoja12 commented on Nov 3, 2026

    @johoja12
    OwnerAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions