Repository navigation
Conversation
1 task done
The companion chat context says how many open comments the artifact has, leaving out resolved threads, then told the agent to call artifact_get_comments with no filter, which returns every thread. The agent was told one number and read another. Name the read with exclude_resolved=true so it matches the count beside it.
iamwhatever
force-pushed
the
fix/artifact-page-open-comments
branch
from
November 19, 2026 05:21
4697e9b to
b7cccac
Compare
This branch has not been deployed
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.
Problem / Motivation
Goal: The artifact page's companion chat reads the same open comments it tells the agent about, not every thread the artifact has ever had.
The companion chat context line says "
<n>open comments", where<n>leaves out resolved threads (commentCountinArtifactDetailPage.tsx, built withfilterCommentsForForward). The next sentence then tells the agent to callartifact_get_commentswith no filter, which returns every thread, resolved ones included. The agent is told 3 and then reads 40, so it reports the larger number and re-reads feedback a human already closed.Why it matters
Anyone who keeps an artifact alive across many review rounds (a cron-built daily report, a living doc) gets the wrong count from the companion chat and pays tokens for closed threads. The page already decided resolved threads are not the agent's work (#11817); the instruction it gives the agent contradicts that one line later.
Not a goal
artifact_get_comments's own default. That is a changed default of an agent tool and is proposed separately in artifact_get_comments: skip resolved threads by default and count threads, not comments #36373.What changed (motivation → approach → change)
Symptom: in the companion chat, the agent reports the total thread count instead of the open count. Cause: the context line counts open threads but names a read that returns all threads. Change: the context line now names
artifact_get_commentswithexclude_resolved=true, so the read matches the count it sits beside. The flag already exists on main; this only uses it.Backwards compatibility
Compatible: the agent reads a subset of what it read before;
exclude_resolvedalready exists on the tool and its route.Removes nothing: the context string changes wording only; the tool, route and stored comments are unchanged, and the agent can still read every thread by calling the tool without the flag.
Tests
ArtifactDetailPage.companionChat.test.tsx"injects the artifact context with a bounded TTL in the background" now asserts the injected context containsexclude_resolved=true.Proof: not provable -- frontend test (prove.py runs Python only)
Checked by hand: with the
ArtifactDetailPage.tsxchange reverted, that test fails; with it applied, both artifact page suites pass (78 tests). eslint andtsc -p tsconfig.app.json --noEmitare clean.Manual verification
N/A: unit coverage sufficient: the change is a background context string injected into the chat, asserted by the test above.
Screenshots / video
Why no screenshot: the change is the text of a background context entry sent to the agent, which the page never renders.
Related Issues
Related to #36373 (that issue proposes the tool-wide default; this fixes the page's own instruction).
Sibling sweep
Swept: git grep -n "artifact_get_comments" -- website/src src/kiro_crew/builtin_skills
Sibling: website/src/pages/ArtifactDetailPage.tsx -- changed here
Sibling: website/src/pages/ArtifactDetailPageHeader.tsx -- not affected -- a code comment only, sent to no agent
Sibling: src/kiro_crew/builtin_skills/artifacts/SKILL.md -- not affected -- it already tells agents the flag exists; its default is #36373's scope
Pattern harvest
Not generalizable: one prompt string named a tool read without the filter its own count used; the general fix is the tool default proposed in #36373.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.