Repository navigation
refactor(vscode): extract task background detection helper - #14107
Merged
Merged
Conversation
Move the background-flag lookup for Task cards into task-tool-state so the component no longer nests the metadata fallback, and reuse the auto() predicate in the open-state effect instead of re-testing status.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
September 14, 2026 08:52
eshurakov
approved these changes
Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
The Task card renderer decided whether a Task part was a background job with an inline expression that nested a
??fallback and twoas Record<string, unknown>casts. The same component also re-encoded the auto-open condition (status === "running" && !background) in its open-state effect, duplicating the existingauto()predicate.Why This Change Was Made
Both spots are small readability and maintenance hazards in code added by #14104. Moving the background lookup into
task-tool-state.ts, beside the existing Task card predicates, gives it a name, a documented precedence rule, and a direct unit test. Reusingauto()in the effect removes the duplicated status check.Behavior is unchanged:
taskBackgroundis the same expression as before, preserving the part-metadata-over-state-metadata precedence.auto()thentaskBackground(), which is equivalent in all background x running combinations.User Impact
None. Internal refactor with no behavior change.
Evidence
bun test tests/unit/task-tool-state.test.tsfrompackages/kilo-vscode/: 4 pass, 0 fail.bun test tests/unit/task-tool-state.test.ts tests/unit/background-agents.test.ts tests/unit/task-tool-hydration.test.ts: 33 pass, 0 fail.bunx eslinton the changed files: clean.