Skip to content

fix(query): wait for AutoDream agent completion - #366

Closed
BunsDev wants to merge 1 commit into
mainfrom
fix/auto-dream-completion
Closed

BunsDev wants to merge 1 commit into
mainfrom
fix/auto-dream-completion

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Superseded by #397, which addresses the ownership and completion findings in #374. The replacement passes local formatting, workspace check, strict Clippy, the full serial workspace suite, and all eight hosted checks at 0aa9388. Closing this proposal without merging; #397 retains the v0.9.0 hold and #374 remains open until delivery.

Summary

  • Wait for the registered background AutoDream agent to finish before recording consolidation success.
  • Release the lock after launch failure, task failure, cancellation, or revoked goal authority. Keep it when completion state cannot be written.

Context

  • Related user request: Goal 3 query-agent and scheduled-work lifetime audit.
  • Scope: claurst-query AutoDream lifecycle and its query-loop call site.
  • Non-goals: changing the global background-agent status contract or the cross-process lock design.

Changes

  • Parse the background launch response into a typed agent ID and follow that task's registry status while preserving monitor output.
  • Propagate completion-state write errors, and add regression coverage for failed persistence, delayed completion, and failed agents.

Validation

All Cargo commands used COVEN_HOME and COVEN_CAVE_HOME under /tmp, CARGO_INCREMENTAL=0, and a single serialized target directory under /tmp.

  • git diff --check — passed.
  • cargo fmt --all and cargo fmt --all -- --check — passed.
  • cargo check --workspace --all-targets --locked — passed.
  • cargo clippy --workspace --all-targets --locked -- -D warnings — passed.
  • cargo test --workspace --locked — passed.
  • Targeted: cargo test -p claurst-query auto_dream::tests --locked — 12 passed. The failed-state-write regression failed against the original behavior before the fix.
  • Not run: TUI script; no TUI or input code changed.

PR Readiness

  • Diff is limited to the intended files.
  • Generated files were not edited by hand.
  • No user-facing docs or help change is needed.
  • No secrets, credentials, local paths, or unrelated logs are included.
  • Remaining risks: AgentTool classifies max-token partial turns as Completed, so AutoDream cannot distinguish that result from a finished turn. On current main, monitor cancellation can mark a task Cancelled before its agent exits; fix(query): stop background agent on monitor cancellation #365 addresses execution cancellation, so lock release at that status still has a window until it lands. The existing one-hour stale-lock rule and cross-process lock acquisition are unchanged. A separate review should decide those contracts before changing them.

Keep consolidation locked until the registered background agent reaches a terminal state. Record success only after completion and a successful state write; release the lock on launch failure, task failure, cancellation, or revoked goal authority.

Coven-Harness: Codex / GPT-6
@vercel

vercel Bot commented Oct 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Oct 18, 2026 7:05am UTC

Request Review

@BunsDev

BunsDev commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

Holding this PR for the completion-contract findings in #374. Registry Cancelled is a cancellation request, not proof that the agent has exited; #365 signals cancellation but does not acknowledge exit. finish_after_launch also stamps successful consolidation for MaxTokens because AgentTool maps that outcome to Completed. Please use a typed execution-completion signal and retain lock ownership through cancellation/cleanup, with delayed-cleanup and partial-response regressions. Full source-level evidence and acceptance criteria are in #374.

This branch was successfully deployed

1 active deployment
Preview — 3104051c Deployed Oct 18, 2026 by vercel[bot]
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