Skip to content

fix: have the artifact chat read only the open comments it counts - #37038

Open
atrasatti wants to merge 1 commit into
kirodotdev:mainfrom
atrasatti:fix/artifact-page-open-comments
Open

atrasatti wants to merge 1 commit into
kirodotdev:mainfrom
atrasatti:fix/artifact-page-open-comments

Conversation

@atrasatti

Copy link
Copy Markdown

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 (commentCount in ArtifactDetailPage.tsx, built with filterCommentsForForward). The next sentence then tells the agent to call artifact_get_comments with 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

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_comments with exclude_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_resolved already 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 contains exclude_resolved=true.

Proof: not provable -- frontend test (prove.py runs Python only)

Checked by hand: with the ArtifactDetailPage.tsx change reverted, that test fails; with it applied, both artifact page suites pass (78 tests). eslint and tsc -p tsconfig.app.json --noEmit are 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

@atrasatti
atrasatti requested review from a team and KiroCrewCaptain as code owners November 14, 2026 03:12
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Nov 14, 2026
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
iamwhatever force-pushed the fix/artifact-page-open-comments branch from 4697e9b to b7cccac Compare November 19, 2026 05:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 19, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant