Repository navigation
fix(kas): send kiro-cli's telemetry opt-out to KAS - #33026
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The opt-out is read at the only place KAS accepts it ( Notes
[DESIGN-REVIEWED] 557b7c9 Description read[DESCRIPTION-READ] 81966a3ab8845364773527b816b7eeea9169c30c10411125ad15077186e0e658 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Each item traces to the reported defect (#32893 P1-36): KAS ignores the kiro-cli opt-out. Two small riders could be deleted. Notes
What this change shipsInventory (7 items) — 5 justifiedIntent: a user who turned kiro-cli telemetry off also gets KAS telemetry off, or is told that Crew cannot confirm it. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 557b7c9 Description read[DESCRIPTION-READ] 6f63e8e15b20c24b5271dbf0be4359e1f4eb1c40643769a657e49acf090b5dbd That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsI checked all five candidates against the diff and the repository code, and none holds up as a real defect. No findings. Notes:
[OPUS-REVIEWED] 557b7c9 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
b7313a7 to
2dfc44e
Compare
|
Pushed Blocking, fixed
Advisory, kept as is
|
KAS reads no cli.json, so kiro-cli's telemetry.enabled opt-out and the KIRO_DISABLE_TELEMETRY / Q_DISABLE_TELEMETRY switches did nothing. Crew now sends _meta.kiro.telemetryEnabled at initialize, failing closed on an unreadable file, and shows a session notice because KAS does not confirm the opt-out (or, for a folder-only opt-out on a shared process, that it was not applied).
2dfc44e to
557b7c9
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved. On this head the review traced every KAS spawn to _handshake_client_capabilities and found no other KAS initialize path. It confirmed that no cli.json or environment value can turn telemetry on, and that all file reads use the existing credential-gated _settings reader off the event loop. It also confirmed that telemetryEnabled survives the Tool Search _meta merge, and the 21 new and changed tests passed in a serial run.
Done well: the check fails closed on blank, malformed and very deep files, and a workspace true cannot undo a global false.
Optional:
- Add a handshake-level test that sets each
TELEMETRY_OFF_ENVname withmonkeypatch.setenvand assertstelemetryEnabled is False. Today, dropping**os.environfrom the merge atruntime_spawn_launch.py:1248turns no test red. test_a_switch_in_agent_env_turns_it_off_and_reaches_launchchecks onlyruntime._spawn_agent_env. Assertrequest.agent_env is runtime._spawn_agent_envon the LaunchRequest, or rename the test.session_telemetry_noticereturns the "telemetry is off" notice without reading the session's folder (kas_cli_settings.py:63). Wording like "telemetry is off for this KAS engine" would be accurate for every session.
KAS reads no cli.json, so kiro-cli's telemetry.enabled opt-out and the KIRO_DISABLE_TELEMETRY / Q_DISABLE_TELEMETRY switches did nothing. Crew now sends _meta.kiro.telemetryEnabled at initialize, failing closed on an unreadable file, and shows a session notice because KAS does not confirm the opt-out (or, for a folder-only opt-out on a shared process, that it was not applied). Original author: Joe Guo (cherry picked from commit 4a75e4c)
…gs (#33347) #33026 imported a skill-projection owner directly, so a kiro_home patched before the facade's first import left the family bound two ways and the facade refused to install; #33221 fixed it. This runs that import order in a fresh interpreter, so a direct owner import coming back turns it red.
Problem / Motivation
Goal: A user who turned kiro-cli telemetry off also gets KAS telemetry off, or is told plainly that Crew cannot confirm it.
KAS reads no kiro-cli
cli.json. A user who settelemetry.enabled: false, or exportedKIRO_DISABLE_TELEMETRY/Q_DISABLE_TELEMETRY, still got KAS telemetry. KAS keeps telemetry on unless the client sends_meta.kiro.telemetryEnabled: falseatinitialize(P1-36 in the kiro-cli -> KAS migration list).Why it matters
An opt-out that silently does nothing is a privacy failure. It hits every user who opted out of kiro-cli telemetry and now runs chats on KAS.
Not a goal
chat.defaultModel(P1-37), the other half of KAS ignores kiro-cli's telemetry opt-out and chat.defaultModel #32893. Three local review rounds each found a real defect where the inherited model becomes the session's pin, so it moved to KAS ignores kiro-cli's chat.defaultModel #33023.telemetry.enabled. It defaults off, so mapping it would turn KAS telemetry off on every install.What changed (motivation → approach → change)
Symptom: the opt-out is ignored on KAS. Root cause: Crew's KAS
initialize(KAS_CLIENT_CAPABILITIES) never carriestelemetryEnabled, and KAS has no other channel for it. Change:acp/kas_cli_settings.py(new) decides the opt-out. It reads<kiro home>/settings/cli.jsonand the workspace's.kiro/settings/cli.jsonthrough the existing credential-gated reader (skill_projection_parts/inheritance_overlay._settings), so it opens no file itself.runtime_spawn_launch._handshake_client_capabilitiesadds_meta.kiro.telemetryEnabledto a copy of the capabilities for a host inclient_meta_settings(KAS). It isfalsewhen either switch is in the child's environment, built in launch's order: the gateway's, thenagent.env, then the spawn'sextra_env. Theagent.envsnapshot read here is passed tolaunch, so both see the same values. It is alsofalsewhen either file'stelemetry.enabledis anything buttrue, or when a file that exists is refused, too large, blank, not JSON or not an object (fail closed)._kas_telemetry_sent). Each KAS chat it creates or loads then gets one notice row saying KAS does not confirm it, so Crew cannot check that it took effect. A chat whose own folder opts out, on a process started with telemetry on, is told the opt-out was not applied to it. Both rows reach the dashboard throughtelemetry_unconfirmed_noticeand_notice_steer_upgrade, like the other session-start notices.agent.acp_backend=kiroon its own engine) is unchanged, because kiro-cli reads its owncli.json.docs/system-specs/modules/acp-client.md, new section "kiro-cli telemetry opt-out on KAS".One choice to note: a workspace
telemetry.enabled: truedoes not undo a globalfalse, although kiro-cli lets the workspace file win. An opt-out is kept whichever file holds it, so a cloned repo cannot turn a user's telemetry back on.Backwards compatibility
Compatible: the new
_meta.kiro.telemetryEnabledfield is sent only to KAS, which already reads it. A user who did not opt out sendstrue, which is KAS's own default.Removes nothing: the diff only adds a handshake field, a notice row and a reader call. No path, key, record or function is taken away.
Tests
test/test_kas_cli_settings.py: each env switch (gateway,extra_env,agent.envwith the snapshot reaching launch); an opt-out in either file; workspacetruevs globalfalse; blank, malformed, non-object, wrong-typed and 100k-deep files all fail closed without aborting the start; the copy leaves the shared constant unchanged; the handshake value; the per-session notice cases; the notice row.test/test_acp_runtime.py: the realcreate_sessionputs the notice on the handle.test/test_acp_bindings.py: the newtelemetry_unconfirmed_noticeproperty row.test/test_worker_agent_load_bracket.py: its hand-built runtime sets the new field.Proof: not provable -- other: reverting the production hunks deletes the new kas_cli_settings module, so the new tests fail at collection and prove.py reports INCONCLUSIVE
Manual verification
N/A — unit coverage sufficient: the change is the handshake payload and a notice row, both asserted on the real code paths. A live KAS run cannot show whether KAS applied the opt-out, because KAS sends no acknowledgement.
Related Issues
Fixes #32893 (telemetry half). Follow-ups, re-checked on latest main:
chat.defaultModel(P1-37).Sibling sweep
Swept: git grep -n "telemetryEnabled|telemetry.enabled" -- src/kiro_crew/acp
Siblings: none -- no other Crew handshake sends a telemetry opt-out, and kiro-cli reads its own cli.json
Pattern harvest
Not generalizable: the defect is one engine reading none of its predecessor's settings file; each migrated setting needs its own wire field.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.