Skip to content

fix(kas): send kiro-cli's telemetry opt-out to KAS - #33026

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/kas-settings-n11b
Nov 8, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/kas-settings-n11b

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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 set telemetry.enabled: false, or exported KIRO_DISABLE_TELEMETRY / Q_DISABLE_TELEMETRY, still got KAS telemetry. KAS keeps telemetry on unless the client sends _meta.kiro.telemetryEnabled: false at initialize (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

What changed (motivation → approach → change)

Symptom: the opt-out is ignored on KAS. Root cause: Crew's KAS initialize (KAS_CLIENT_CAPABILITIES) never carries telemetryEnabled, 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.json and the workspace's .kiro/settings/cli.json through the existing credential-gated reader (skill_projection_parts/inheritance_overlay._settings), so it opens no file itself.
  • runtime_spawn_launch._handshake_client_capabilities adds _meta.kiro.telemetryEnabled to a copy of the capabilities for a host in client_meta_settings (KAS). It is false when either switch is in the child's environment, built in launch's order: the gateway's, then agent.env, then the spawn's extra_env. The agent.env snapshot read here is passed to launch, so both see the same values. It is also false when either file's telemetry.enabled is anything but true, or when a file that exists is refused, too large, blank, not JSON or not an object (fail closed).
  • KAS does not confirm the opt-out. The runtime records what it sent (_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 through telemetry_unconfirmed_notice and _notice_steer_upgrade, like the other session-start notices.
  • kiro-cli (agent.acp_backend=kiro on its own engine) is unchanged, because kiro-cli reads its own cli.json.
  • Spec: docs/system-specs/modules/acp-client.md, new section "kiro-cli telemetry opt-out on KAS".

One choice to note: a workspace telemetry.enabled: true does not undo a global false, 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.telemetryEnabled field is sent only to KAS, which already reads it. A user who did not opt out sends true, 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.env with the snapshot reaching launch); an opt-out in either file; workspace true vs global false; 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 real create_session puts the notice on the handle.
  • test/test_acp_bindings.py: the new telemetry_unconfirmed_notice property 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:

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

  • 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

Contributions are accepted under the project's Apache-2.0 license.

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 8, 2026 07:58
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 557b7c9ec425dbfea8a674b945280f557b805413 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 557b7c9ec425dbfea8a674b945280f557b805413 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. The opt-out is read at the only place KAS accepts it (initialize on AcpRuntime; AcpClient has no KAS arm), it fails closed, and it can be reverted cleanly.

Notes

  • "Each KAS chat it creates or loads then gets one notice row": a user who opted out sees the same unconfirmed-telemetry row on every chat, with nothing they can do about it. Showing TELEMETRY_UNCONFIRMED_NOTICE once per process, and the per-chat row only for TELEMETRY_NOT_APPLIED_NOTICE, would keep the disclosure without the repetition.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 557b7c9ec425dbfea8a674b945280f557b805413 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • Item 6 — undeclared: the description never mentions the warning that _warn_opt_out_unconfirmed logs once per process. It says the same thing as the per-session notice row in item 4. Subtraction: delete _warn_opt_out_unconfirmed and _OPT_OUT_WARNED, and let the notice row be the one place that says it.
  • Item 7 — one consumer, generalized: _read(path) only calls _settings(path) and has one caller. Subtraction: delete _read and call _settings directly in kiro_cli_telemetry_enabled.

What this change ships

Inventory (7 items) — 5 justified

Intent: 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.

  1. A KAS handshake now carries telemetryEnabled: false when the env switches or either cli.json opt out — justified
  2. A file that exists but cannot be read sends telemetry off (fail closed) — justified
  3. A workspace true no longer undoes a global false — justified
  4. Each KAS chat after an opt-out shows a row: "KAS does not confirm this" — justified
  5. A chat whose own folder opts out, on a process started with telemetry on, is told the opt-out was not applied — justified
  6. A one-time gateway log warning about the opt-out — undeclared; says the same as item 4
  7. A private _read wrapper around _settings — one consumer, generalized

[FIRST-PRINCIPLES-REVIEWED] 557b7c9

Description read

[DESCRIPTION-READ] 6f63e8e15b20c24b5271dbf0be4359e1f4eb1c40643769a657e49acf090b5dbd

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 557b7c9ec425dbfea8a674b945280f557b805413 — this comment is updated in place on each push.

Review details

I checked all five candidates against the diff and the repository code, and none holds up as a real defect.

No findings.

Notes:

  • Two wording points are real but not defects. When a cli.json can't be read, the unconfirmed notice still says "your kiro-cli telemetry is off". The not-applied notice always blames "this folder", even when the global file is what changed.
  • The new notice row has no meta["notice"] token, so it shows in English on every locale. The rows already produced in that loop have no token either.

[OPUS-REVIEWED] 557b7c9

Verdict parsed from the review's SHA-scoped output markers for commit 557b7c9ec425dbfea8a674b945280f557b805413.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 557b7c9ec425dbfea8a674b945280f557b805413 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 557b7c9ec425dbfea8a674b945280f557b805413 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 557b7c9

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 557b7c9ec425dbfea8a674b945280f557b805413 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 8, 2026
@iamwhatever
iamwhatever force-pushed the fix/kas-settings-n11b branch from b7313a7 to 2dfc44e Compare November 8, 2026 08:43
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Pushed 2dfc44e7fe, rebased on main ece4f407e2, as one commit. Here is how each finding on b7313a7e8a was handled.

Blocking, fixed

  • First Principles, second cli.json reader: _read now calls the credential-gated inheritance_overlay._settings, and refusals map to _UNREADABLE_SETTINGS_ERRORS. This module no longer opens any file itself, and its own size cap and error type are gone. This also fixes GPT F1, the read that bypassed the gate.
  • GPT F2, agent.env was ignored: the handshake reads the agent.env snapshot, judges the switches on gateway env, then agent.env, then extra_env, and passes that snapshot to launch (LaunchRequest.agent_env). Test: test_a_switch_in_agent_env_turns_it_off_and_reaches_launch.
  • GPT F3, RecursionError: it is in _UNREADABLE_SETTINGS_ERRORS, so a deeply nested file now sends telemetry off and does not abort the start. Test: test_a_deeply_nested_file_fails_closed_without_aborting.
  • GPT F4, agent.acp_backend=kiro remedy: removed from both notices and from the log line. They now say only that KAS does not confirm the opt-out, so Crew cannot check that it took effect. The "older KAS may ignore it" claim is gone too, because it cited no version.
  • CI reds from this diff: the runtime owner field lists (test_runtime_bindings), the backend-identity check (the gate is now self._harness.client_meta_settings, the membership answer), the hand-built runtime in test_worker_agent_load_bracket, and the PR template sections.

Advisory, kept as is

  • First Principles item 6 and Design note 1, a notice row on every KAS chat after an opt-out: kept on purpose. The owner asked that when Crew cannot be sure KAS honors the opt-out, the user is told plainly. A gateway log line does not reach the user. The row appears only for users who opted out.
  • Design note 2, chats outside the dashboard get no row: true. This uses the same session-start notice path as the other KAS notices (_notice_steer_upgrade), and none of those reach Slack, Discord or the CLI today. Widening that path is out of this PR's scope.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 8, 2026
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).
@iamwhatever
iamwhatever force-pushed the fix/kas-settings-n11b branch from 2dfc44e to 557b7c9 Compare November 8, 2026 12:17
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 8, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 557b7c9. Turning off kiro-cli telemetry now also turns it off for KAS. Non-blocking: users with telemetry off see a notice on every new KAS chat, which may feel noisy.

@KiroCrewCaptain
KiroCrewCaptain merged commit 4a75e4c into main Nov 8, 2026
99 of 100 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/kas-settings-n11b branch November 8, 2026 13:24

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_ENV name with monkeypatch.setenv and asserts telemetryEnabled is False. Today, dropping **os.environ from the merge at runtime_spawn_launch.py:1248 turns no test red.
  • test_a_switch_in_agent_env_turns_it_off_and_reaches_launch checks only runtime._spawn_agent_env. Assert request.agent_env is runtime._spawn_agent_env on the LaunchRequest, or rename the test.
  • session_telemetry_notice returns 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.

@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
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)
buluoray added a commit that referenced this pull request Nov 8, 2026
#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.
KiroCrewCaptain pushed a commit that referenced this pull request Nov 8, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KAS ignores kiro-cli's telemetry opt-out and chat.defaultModel

3 participants