Skip to content

fix(chat): show the kas telemetry notice once per chat - #35786

Closed
keyejia wants to merge 1 commit into
kirodotdev:mainfrom
keyejia:fix/telemetry-notice-once
Closed

keyejia wants to merge 1 commit into
kirodotdev:mainfrom
keyejia:fix/telemetry-notice-once

Conversation

@keyejia

@keyejia keyejia commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A KAS chat shows the "telemetry is off" notice once, not again on every new session of the same chat.

With kiro-cli telemetry off, a dashboard chat on the KAS harness shows the "Your kiro-cli telemetry is off..." notice again and again. In a long chat it shows on almost every message.

Why it matters

Everyone who opts out of kiro-cli telemetry and chats on KAS gets the same row repeated through the chat. It buries the conversation and makes a one-time fact look like a new warning each time.

Not a goal

  • Changing what the notice says, or when the opt-out is sent to KAS.
  • Holding any other session-start notice (adapter version, agent prompt, tested version, withheld credentials, default model, permission mode) to once per chat.
  • Remembering the notice beyond the chat's loaded window (see the shortcut: comment).

What changed (motivation → approach → change)

A chat goes through many KAS sessions: a new one after an idle timeout, a gateway restart, or a model, project or harness switch. Each carries the notice, and the dashboard added a row on the first turn of each, with nothing to say the chat already showed it.

The session-start notice step (_notice_steer_upgrade in src/kiro_crew/dashboard/chat_turn/turn_spec_hooks.py) now skips the telemetry notice when the chat's loaded window already holds a notice row with the same text. A changed answer ("not applied") has different text, so it still shows. The owning spec section says so.

Backwards compatibility

Compatible: only the dashboard's notice rows change; no stored row, setting or API shape changes.

Removes nothing: the notice still shows on a chat's first KAS session and whenever its text changes; only repeats of a row the chat already shows are skipped.

Tests

  • test_a_chat_shows_the_telemetry_notice_once_across_its_sessions: three sessions of one chat give one row; a changed answer adds a row; the adapter-version notice still shows on every session.
  • test_a_telemetry_row_from_another_role_does_not_hold_back_the_notice: the same words in a non-notice row do not count.

Proof: PROVEN test/test_kas_cli_settings.py::test_a_chat_shows_the_telemetry_notice_once_across_its_sessions (head 10beda3)

Determinism: both new tests and their two neighbours passed 20 runs at -n0, the whole file passed 10 runs at -n 4, and 5 shuffled orders passed.

Manual verification

N/A — unit coverage sufficient: the change is one check on the chat's rows before a notice row is added, and the tests drive that step directly.

Related Issues

Closes #35781

Sibling sweep

Swept: git grep -n "telemetry_unconfirmed_notice|kas_telemetry_notice" -- src/
Siblings: none -- the dashboard's session-start notice step is the only place that turns this notice into a chat row.

Pattern harvest

Not generalizable: the other session-start notices are about the installed adapter and are meant per session; only this one states a per-chat fact.

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

A chat goes through many KAS sessions: a new one after an idle timeout,
a gateway restart, or a model, project or harness switch. Each session
carries the "telemetry is off" notice, and the dashboard added a notice
row on the first turn of every one, so a long chat showed it on almost
every message.

_notice_steer_upgrade now skips the telemetry notice when the chat's
loaded window already holds a notice row with the same text. A changed
answer (the opt-out was not applied) has different text and still
shows. The other session-start notices are unchanged.

Closes kirodotdev#35781
@keyejia
keyejia requested review from a team and KiroCrewCaptain as code owners November 12, 2026 08:33
@keyejia
keyejia requested a review from mbriones98 November 12, 2026 08:33
@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 12, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

This PR and #35788 both close #35781 and make the same fix: the KAS telemetry-off notice shows once per chat. Both change _notice_steer_upgrade in src/kiro_crew/dashboard/chat_turn/turn_spec_hooks.py, the same paragraph of docs/system-specs/modules/acp-client.md, and test/test_kas_cli_settings.py.

Please keep one of #35786 and #35788 and close the other, carrying over anything only this one has.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider raised 1 possible problem and estimates a 50% chance that this change introduces a defect; a person should check it.

The fix stops the KAS telemetry notice repeating in the common case. But its "any identical notice row in the window" check hides an answer that comes back after a change. A chat whose sessions alternate between NOT_APPLIED and UNCONFIRMED (possible because the process telemetry setting comes from whichever folder started the process) loses the second NOT_APPLIED warning. The newest row then wrongly says the opt-out was sent. This contradicts the PR's and the spec's claim that a changed answer still shows. Compare against the latest telemetry row instead, and add a test for that sequence.

Things to check (possible problems the decider raised; at this confidence many turn out to be fine):

  • The PR and the updated spec both say a changed answer still shows. That is only true the first time each answer appears. Sequence NOT_APPLIED -> UNCONFIRMED -> NOT_APPLIED: the third notice is skipped because an identical row is already in the window. The newest telemetry row then says Crew asked KA (src/kiro_crew/dashboard/chat_turn/turn_spec_hooks.py, medium)

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 10beda3959 · 80 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 12, 2026
@keyejia keyejia closed this Nov 12, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 12, 2026
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) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KAS chat repeats the "telemetry is off" notice each time its session restarts

2 participants