Skip to content

fix(background): retain review evidence through promotion - #573

Merged
agenteinstinct1-max merged 5 commits into
dev-vibecodedfrom
fix/343-promoted-review-evidence
Oct 24, 2026
Merged

agenteinstinct1-max merged 5 commits into
dev-vibecodedfrom
fix/343-promoted-review-evidence

Conversation

@agenteinstinct1-max

@agenteinstinct1-max agenteinstinct1-max commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Issue for this PR

Refs #343

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Keep the producer-owned metadata object when a foreground BackgroundJob is promoted. start already retains that object, and TaskTool writes late review evidence into it. Replacing the object during promotion hid that evidence from the parked-parent resume path.

The ownership contract is now explicit: metadata stays live for the producer across promotion; returned observations shallow-copy its top level, not nested values. TaskTool is the only production start caller found. This preserves the existing contract rather than adding a metadata patch API.

The nested TaskTool regression uses the real TaskTool, registry and Session services. For the resumed incoming report it now calls production SessionPrompt.Service.prompt with noReply:true, exercising actual input-part resolution and persistence instead of manually saving those parts. It asserts the persisted reviewLoop evidence and next outer UNREVIEWED notification. Model responses remain synthetic; this is not full LLM/TUI end-to-end acceptance. The original settled-before-park test remains unchanged. #343 stays open pending review and scope reconciliation.

How did you verify your code works?

  • Core background jobs: 11 passed, 427 assertions.
  • TaskTool and legacy background jobs: 84 passed, 408 assertions.
  • Restoring the old promotion copy makes the nested regression fail at the earlier persisted reviewLoop evidence assertion (0 passed, 1 failed, 6 assertions); the later UNREVIEWED assertions are not reached.
  • Core regression covers late producer writes, promotion, get/list/wait observations and top-level snapshot independence.
  • git diff --check passes. Exact-head Linux/Windows/typecheck and standards/compliance CI are green; actual Kilo comment is clean. Independent review resolved the SessionPrompt-path finding at this head.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@kilo-code-bot

kilo-code-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • packages/opencode/test/tool/task.test.ts
Previous Review Summaries (2 snapshots, latest commit 8b641a0)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 8b641a0)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • packages/core/src/background-job.ts
  • packages/core/test/background-job.test.ts
  • packages/opencode/test/tool/task.test.ts

Previous review (commit be01ae7)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • packages/core/src/background-job.ts
  • packages/core/test/background-job.test.ts
  • packages/opencode/test/tool/task.test.ts

Reviewed by free · Input: 22.4K · Output: 895 · Cached: 137.9K

@agenteinstinct1-max
agenteinstinct1-max merged commit 511d574 into dev-vibecoded Oct 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant