Skip to content

feat(metrics): count session-control calls by op, caller kind and outcome - #22220

Merged
iamwhatever merged 1 commit into
mainfrom
feat/21270-session-control-calls
Oct 20, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
feat/21270-session-control-calls

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: make it answerable which session-control operations agents actually reach for, and how often each one fails.

Session control is the set of MCP tools an agent uses to act on ANOTHER live conversation: open one, send into it, stop its turn, read its tail, adopt it, close it. People use the dashboard for all of that, so every caller of those routes is an agent -- and today nothing counts them.

kirocrew.tool.call.duration looks like it should answer this and cannot. That instrument labels a call by its ACP tool_kind, and an MCP-served call is labelled mcp whatever kind it reported. That is the right trade there (an MCP server's kind vocabulary is its own, and "this left the process over MCP" is the more useful fact for a latency histogram) and exactly the wrong grain here: all eighteen session-control verbs, every other installed server's tools, and their outcomes collapse into one series. So "do agents use fork?", "is broadcast failing?" and "how much of the crew's work is driven by a conductor versus a crewmate?" have no answer at all.

Why it matters

Session control is the mechanism the whole multi-session product rests on -- a conductor dispatching workers, a crewmate patrolling what it created, a team lead stopping a wedged turn. Decisions about which of those verbs to improve, simplify or retire are currently made with no usage signal: an operation nobody calls and an operation that fails half the time look identical from outside. A failure rate per verb is also the cheapest early warning that one of these paths has regressed for agents, who cannot file a bug about it.

Not a goal

  • Latency. This is a counter, not a duration: how long a session-control call takes is kirocrew.tool.call.duration's question and stays there.
  • Per-session, per-target or per-caller-identity counts. No session id, slot key, agent name or target reaches an attribute; the caller is folded to a kind before the recorder sees it.
  • Changing the session-control surface itself. No route, no auth gate, no refusal, no status code and no audit line changes behaviour here.
  • The other metrics in the same wave (session-tree shape, monitor loops, the work ledger, event sources, crew log health). Each is its own PR.
  • Where these numbers are sent, and which of them leave the machine.

What changed (motivation → approach → change)

Not a product-shape change: no default moves, no user-facing capability is added, changed or removed, and no loop, monitor, agent or command behaves differently. The diff adds one counter and its documentation row.

What the existing instruments already answer, and the one thing they do not

The First Principles lane is right, and the description above understated it: kirocrew.gateway.request.duration already counts these routes, so "today nothing counts them" is wrong as written. Naming that instrument is the only honest way to say what is left.

kirocrew.gateway.request.duration (metrics/http_metrics.py::REQUEST_METRIC) is recorded by make_route_latency_middleware, mounted app-wide (server_runtime/middleware_chain.py:211,331), and labelled method x route_template x status_class. route_template is the matched resource's canonical template, so each of these twenty paths gets its own label value, and status_class buckets the answer to 2xx..5xx. Per-route volume and per-route failures for /api/session-control/* are readable there today, and this counter does not replace that: for "how many fork calls, how many of them 4xx", the request histogram is the instrument.

What neither instrument carries is who called. The request histogram has no caller-identity label, and that is not an oversight to correct in place: its label domain is deliberately bounded at (len(known_templates) + 1) x 8 x 6, where known_templates is every route the gateway registers. Adding a 16-value caller axis there would multiply the entire gateway's route table by sixteen in order to learn something about twenty paths. A separate counter scoped to those twenty paths is the smaller change, bounded at 608 series total.

op and outcome are kept on this counter as the dimensions caller is crossed with, not as a second way to count a request: "which verbs does a conductor drive, and which of them fail for it" is one question, and dropping either dimension leaves a caller count that cannot be attributed to an operation. That the Goal line above does not name the caller axis is a real gap between the Goal and the diff, and amending a frozen Goal is a maintainer's call, not this PR's -- it is flagged for the design sign-off the tier:T3 issue already requires rather than papered over here.

Approach

Two sources were available: a counting fold over the caller's tool-call entries in the crew log, or the /api/session-control/* handlers themselves. The handlers win because they are the operation's single commit point and they already hold both facts a fold would have to infer -- the outcome, and the calling session. A crew-log tool-call entry records that a tool was called, not what the route answered, so a fold would have to pair an entry with a later result to say ok or error, and a pairing that can go wrong is a counter that can over-count. One wrapper per route cannot.

What was built

  • src/kiro_crew/metrics/session_control_calls.py holds the counter, the two classifiers and the emit. This module DEFINES the op list; no other file holds a copy of it, and no document on main specifies it.
    • op -- the verb. Spelled as the TOOL's verb rather than the route's path segment, so /api/session-control/read is read_message (the session_read_message tool) and /set-model is set_model: the question is which tool an agent reached for, and the tool verb is the stable name of the two. classify_op folds an unlisted value to other so a route added without a row cannot mint a series. revive and history are registered routes the list does not name, and both land in other -- their own per-route volume stays readable off the request histogram, which labels every route by its own template, so the fold loses nothing that is only available here.
    • caller -- the kind of agent that called. Derived from agent_files.OWNED_KIRO_AGENT_FILES (file stem minus kirocrew-, - rewritten to _) rather than tabulated by hand, so a new owned agent file joins the enum with no table to update and cannot fall silently into other. A crewmate's pinned DM session is identified by its SLOT KEY's shape (members.is_member_session_key), because such a slot's agent field carries the crewmate's own crew name and could only ever answer other. An agent name outside the owned set -- a third-party agent, a user-authored template -- is other. A BLANK agent on a resolved slot is default, not other: _ChatSlot takes agent: str = "" and an ordinary dashboard chat is minted without one, so the blank is what the largest caller population carries, and crew_log/emit_session.py already reads it that way (agent or _DEFAULT_AGENT). A caller whose slot could not be resolved AT ALL is other -- same blank agent, different answer, and classify_caller's slot_found parameter is where that line is drawn.
    • outcome -- ok below status 400, error otherwise, and error for a handler that raised.
  • dashboard/handlers/session_control.py::_counted wraps each of the twenty registered handlers and is the only emit site, so the deferred route binder calling a handler cannot count the same call twice. It sits OUTSIDE each handler's own _require_internal / member gate deliberately: a caller refused there made a session-control call that happened and failed, and a wrapper placed under the gate would not see it. A handler that raises is counted error and its exception re-raised untouched, so this only ever ADDS the count -- the response, the status and the SEL audit line stay the handler's own.
  • The caller classification reads LIVE STATE ONLY: the in-memory slot registry, via get_slot first (the header is often already the slot key) and caller_access.caller_slot_key's walk as the fallback for a caller authenticating as its history key. No file is read, written or stat'ed on a route an agent is waiting on, and an unresolvable caller is other rather than a failure.
  • Nothing in production exists only for the tests: the route-to-op mapping is asserted by calling each registered route and reading the op off the real emit, not off an annotation on the handler.
  • Best-effort throughout, behind telemetry.enabled: a disabled process holds a recorder with no meter and the emit returns before touching an instrument. A failing classifier or a failing recorder cannot fail a session-control call, and both are tested.

On the caller enum and the crew-log fold

An agent_kind classifier with the same vocabulary is being added to the crew-log usage fold with a hand-written stem-to-kind table. It is not on main, so this PR derives the value instead of copying the table -- and the derivation produces exactly the same sixteen values. test_the_derived_set_equals_the_hand_written_agent_kind_table asserts that against a literal set written out in the test, so the two cannot drift apart unnoticed, and one function can serve both callers once both have landed.

Backwards compatibility

Compatible: the diff is additive (+933, -0). No route, signature, field, validator or status code changes; every handler keeps its name, its response and its refusals, and the wrapper is transparent to both the router and the handler-level tests that call these functions directly.

Removes nothing: no path is hidden, no record or row is deleted, no validator is tightened, no data is migrated or pruned, and no key or public function is removed or renamed.

Tests

test/metrics/test_session_control_calls.py (95 cases). The module docstring maps each guarantee to the one-line change that reddens its test, so a later reader can reproduce the proof rather than trust it.

  • The eighteen ops, parametrized. One completed call per op is exactly one count at {op=<that op>, caller=..., outcome=ok}, driven end to end through the real _counted wrapper.
  • An unnamed op folds to other, including the two reachable ones (revive, history) and an invented verb.
  • Every registered route counts its own verb, derived from the LIVE router via _register_mcp_routes: each route is called with an unauthenticated request, its own gate refuses with 403, and the op is read off the resulting emit. So the assertion is about what the counter records, not about an annotation. A twenty-first route, or a decorator carrying the wrong verb, reds here.
  • Every named op is reachable from a real route -- an op in the enum that no route emits would be a value the dashboard waits for forever.
  • Outcome. A 400 / 403 / 404 / 409 / 500 / 503 response is exactly one count with outcome=error; a handler that raises is one error count and the exception is re-raised unchanged; two calls are two counts.
  • A call refused before the handler body runs is still counted -- api_session_control_stop with no internal_auth answers 403 and emits one {op=stop, outcome=error}. This reds the moment the wrapper is moved under the auth gate.
  • Caller classification from a real request: a crewmate DM slot reads crewmate even though its agent is a crew name; an owned agent's slot reads its kind; an ordinary dashboard chat with a blank agent reads default; an unknown agent reads other; an unresolvable caller and an app with no state read other without raising; a history key resolves through the slot walk.
  • The two blanks, kept apart: a blank agent on a resolved slot is default, a blank agent with no slot is other, and a crewmate key wins over both with no slot at all.
  • The caller enum: the derived set equals the hand-written agent_kind table literally; every owned agent file has a kind and none falls through to other; a hyphenated stem becomes an underscored kind; three unowned names cannot mint a series.
  • Privacy: with the request and the slot both full of identifying strings (session key, slot key, crew name, third-party agent name, route path), the emitted attribute set is exactly {op, caller, outcome} and no attribute value contains any of them. The whole series space is asserted bounded.
  • Telemetry off: a MetricsRecorder(None) process creates no instrument at all (_counters == {}), and a route still answers 200 with telemetry disabled.
  • Best-effort: a classifier that throws degrades the attribute to other and the route still answers 200; a recorder that throws does not raise.

Also run: test/test_session_control_member_gate.py, test/test_session_control_parts_contract.py, test/test_session_control_doc.py -- all pass together with the new file. scripts/docs_lint.py, scripts/check_comment_history.py, scripts/check_brand_name.py, flake8, isort and black are clean.

Manual verification

N/A -- unit coverage is sufficient and more faithful here: the tests drive the real wrapper, the real classifiers and the real router, and the one thing a manual run adds (an actual exported data point) is the recorder's own contract, already covered by test/metrics/test_recorder.py.

Related Issues

Part of #21270.

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

I confirm that this contribution is made under the terms of the Apache-2.0 license.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 03ebea15fa822fa4c4d7da42ca99640515a02f52 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 03ebea15fa822fa4c4d7da42ca99640515a02f52 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check before merging: the Goal line never mentions the caller axis, which the PR says is the counter's only reason to exist; a maintainer should accept the Goal as written.

[DESIGN-REVIEWED] 03ebea1

Description read

[DESCRIPTION-READ] 35befa57cc66ec2b40d37bd326c951a67b55ad5cd7483dc083bb7e6b9e62ef95

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 Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of 03ebea15fa822fa4c4d7da42ca99640515a02f52 — 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/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The counter's op × outcome half repeats kirocrew.gateway.request.duration. Only the caller axis is new, and the frozen Goal never asks for it.

Not justified as shipped

  • Item 1 — duplicate of src/kiro_crew/metrics/http_metrics.py::REQUEST_METRIC: the Goal asks "which session-control operations agents actually reach for, and how often each one fails". REQUEST_METRIC already labels every one of these 20 routes route_template × status_class (http_metrics.py:243-244). The description admits this ("Per-route volume and per-route failures … are readable there today"), which contradicts its own "today nothing counts them". So, judged against the Goal, shipping this costs nobody anything. The counter's only reason to exist is item 2.
    Subtraction: if the caller axis is not wanted, delete session_control_calls.py, _counted/_caller_kind and the 20 decorators, and answer the Goal from REQUEST_METRIC.
    Clears when: a maintainer amends the Goal to name the caller-kind question, or the counter is removed.

What this change ships

Inventory (6 items) — 4 justified

Intent: let maintainers see which session-control verbs agents use and how often each fails. This is an ADDITION.

  1. New counter of session-control calls by verb and ok/error — duplicate of metrics/http_metrics.py::REQUEST_METRIC
  2. Each call labelled with the calling agent's kind (conductor, crewmate, worker…) — undeclared: the Goal does not name it
  3. All 20 session-control routes counted, including refused and raised calls — justified
  4. revive and history counted together under one other verb — justified
  5. Default-agent chats counted as default, unresolvable callers as other — justified
  6. New metrics.md spec row — justified

[FIRST-PRINCIPLES-REVIEWED] 03ebea1

Description read

[DESCRIPTION-READ] aa9e441c63bdfb045f3521219abde2e55a524b7f9143ffca4e86e03f499b6045

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 Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 03ebea15fa822fa4c4d7da42ca99640515a02f52 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 03ebea1

Verdict parsed from the review's SHA-scoped output markers for commit 03ebea15fa822fa4c4d7da42ca99640515a02f52.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 03ebea15fa822fa4c4d7da42ca99640515a02f52: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 03ebea15fa822fa4c4d7da42ca99640515a02f52 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 03ebea1

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 03ebea15fa822fa4c4d7da42ca99640515a02f52: <one-sentence reason>

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 19, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

Thanks for this. The branch has a merge conflict with main in docs/system-specs/modules/metrics.md (the metrics table). Please rebase on current main and push. CI and the review lanes will then run on the new head.

Review of head 4f1914f751962f0f0f7e638562f179e18170da10, done before the rebase:

  • No must-fix findings. The _counted wrapper sits outside the auth gate, re-raises unchanged, and is the only emit site. The caller lookup only reads in-memory slot state (get_slot, then caller_slot_key), so it adds no disk access to these routes.
  • Should-fix 1: the First Principles lane is right that kirocrew.gateway.request.duration already counts every /api/session-control/<verb> route by route_template and status_class. Only the caller axis is new. Please name that histogram in the description and say why caller needs a separate counter and is not an attribute on that histogram.
  • Should-fix 2: the code comments in session_control_calls.py and the handler say the op list comes from "the RFC". No file under docs/request-for-change/ defines it. Please link the RFC, or change the comments so they state that this PR sets the list.

The linked issue is a tier:T3 issue, so this needs a design sign-off from a maintainer before merge.

@chenmingwei23
chenmingwei23 force-pushed the feat/21270-session-control-calls branch from 4f1914f to ed94601 Compare October 19, 2026 16:11
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 19, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/21270-session-control-calls branch from ed94601 to a2ecae3 Compare October 19, 2026 16:37
@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 Oct 19, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/21270-session-control-calls branch from a2ecae3 to a0ff631 Compare October 19, 2026 16:40
@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 Oct 19, 2026

@bolichen97 bolichen97 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.

Thanks for the rebase. Review of head a0ff6319ee57f7706041d5dea2f5da87dd7fc79b.

The merge conflict in docs/system-specs/modules/metrics.md is gone, and the branch is one commit on main.

Both should-fix items from the earlier review are addressed:

  • Overlap with kirocrew.gateway.request.duration: the description and the spec row now name that histogram, say that per-route volume and failures are readable there, and give the reason caller is a separate counter (adding it to the gateway histogram multiplies every route by sixteen). This answers the point.
  • "The RFC" in code comments: the comments now say this module defines the op list and no document on main specifies it. One leftover is the test name test_the_closed_list_is_the_rfcs_eighteen in test/metrics/test_session_control_calls.py. A rename such as test_the_closed_list_has_eighteen_ops keeps the name true. This is a nit and does not block.

No must-fix findings on this head. The _counted wrapper, the outcome rule and the caller classifier are unchanged in behavior from the earlier review.

One point is still open from the First Principles lane on this head: revive and history fold to op=other, so the caller axis, which the PR names as the reason for this counter, is lost for those two routes. Please either add them to the op list (the route test then counts each route by its own verb), or state in the description why counting them is not wanted.

CI note: the red Fast Gate comes from the harness parity x-capture check, which reports a stale allowlist entry. The same Fast Gate fails on main today, so this PR does not cause it. Coverage Gate and the cancelled lane follow from it.

The linked issue is a tier:T3 issue, so this needs a design sign-off from a maintainer before merge. I am leaving a comment, not an approval.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Answering the two advisory suggestions on a0ff6319ee57f7706041d5dea2f5da87dd7fc79b together, once: both ask this PR to change the attribute shape that the wave-2 metrics RFC specifies for this counter, so this PR keeps the RFC's shape and the suggestions belong on the RFC.

The RFC is #22180, docs/request-for-change/rfc-crew-usage-metrics.md, section 6.1. Its table for kirocrew.crew.session_control.calls fixes all three attributes: op as the eighteen-value closed tool list, caller as the agent_kind enum, and outcome as ok / error. This PR implements that row literally.

First Principles (CONCERNS, advisory) -- Item 3, fold revive and history into their own ops. The eighteen values are the RFC's list, and revive and history are not in it; classify_op folding an unlisted route to other is what makes the list closed rather than a copy of the route table. Promoting two routes into the enum is a change to the RFC's attribute domain, not to this implementation of it. The finding is right that the fold costs the caller axis for those two routes, and that cost is real -- it is the argument for amending the RFC's list, which is where the series budget for the whole wave is decided. This PR deviating from the row unilaterally would leave the RFC and the code disagreeing about what the counter's domain is, which is worse than the gap the finding names.

Design Review (PASS, advisory) -- split outcome into client_error and server_error. Same answer: the RFC's row says ok / error, and the RFC notes that a backend which should not carry the full series count can drop outcome from its dimensions -- so the width of that attribute is part of a budget stated there, not a local choice. The suggestion is a good one and the 4xx-versus-5xx distinction is worth having; it is a one-value amendment to the RFC row, after which the implementation follows in a line.

Neither finding is blocking, neither is an over-count, a privacy leak or a performance problem, and no defect in the code this PR adds is left unfixed. Flagging both on #22180 rather than pushing a shape here, so this counter and the RFC that specifies it stay in agreement.

@chenmingwei23
chenmingwei23 force-pushed the feat/21270-session-control-calls branch from a0ff631 to d0ef91d Compare October 19, 2026 17:21
@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 readiness: checking Automated validation is still running labels Oct 19, 2026
…come

Add kirocrew.crew.session_control.calls, a counter with three closed
attributes: op (the eighteen session-control tool verbs, anything else
other), caller (the agent_kind enum, derived from OWNED_KIRO_AGENT_FILES)
and outcome (ok / error).

tool.call.duration cannot answer which session-control verbs agents use:
it labels an MCP-served call mcp whatever kind it claimed, folding all
eighteen verbs and every other server's tools into one series.

The emit site is one wrapper per route, placed outside each handler's own
internal-auth gate so a call refused before the handler body runs is still
counted once, with outcome=error. It is the only emit site, so the
deferred route binder cannot count a call twice. Classification reads live
in-memory state only: no disk read lands on the request path.
@chenmingwei23
chenmingwei23 force-pushed the feat/21270-session-control-calls branch from d0ef91d to 03ebea1 Compare October 19, 2026 17:49
@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 Oct 19, 2026

@bolichen97 bolichen97 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.

Incremental review of head 03ebea15fa822fa4c4d7da42ca99640515a02f52 against the previous head a0ff6319ee57f7706041d5dea2f5da87dd7fc79b.

The branch is rebased onto the current main and stays one commit. The only code change since the last review is how _caller_kind reaches caller_slot_key:

  • The session-control handler module (dashboard/handlers/session_control.py) now calls sc.caller_slot_key through the session_control facade instead of a local import from caller_access. The facade re-exports that name, and the module already imports the facade as sc, so this matches the other calls in the file.
  • test/metrics/test_session_control_calls.py patches caller_slot_key on the same facade. The patch target and the call site now agree, so the history-key fallback test exercises the real lookup path.

No new findings on this change. The wrapper, the outcome rule and the caller classifier are unchanged in behavior.

Still open from the earlier review:

  • revive and history fold to op=other, so the caller axis is lost for those two routes. Please add them to the op list, or say in the description why counting them is not wanted.
  • Nit: the test name test_the_closed_list_is_the_rfcs_eighteen still names an RFC. A name such as test_the_closed_list_has_eighteen_ops keeps it true.

CI and the review lanes are still running on this head, so I make no claim about their results.

The linked issue is a tier:T3 issue, so this needs a design sign-off from a maintainer before merge. I am leaving a comment, not an approval.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 19, 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 03ebea1. Approve on the code; merging waits on the design decision for #22180.

All three attributes are closed: op is the 18 tool verbs plus other, caller is 16 values derived from OWNED_KIRO_AGENT_FILES plus default, crewmate and other, and outcome is ok or error. record_session_control_call folds each attribute at the emit site, so no agent name, session key or error string can reach the recorder. Mutating that fold or the classifier fallback turns test_an_out_of_set_attribute_is_folded_at_the_emit_site and test_an_unowned_agent_name_cannot_mint_a_series red. The _counted wrapper covers all 20 registered routes and re-raises handler exceptions untouched. The caller lookup reads only the in-memory slot registry and swallows its own failures, so a session-control call cannot fail because of the counter. The related tests pass on this head (382).

Follow-ups, not blocking:

  • RFC 22180 section 6.1 still states 18 x 6 x 2 = 216 series, but the caller enum here has 16 values (608 series, as the spec row says). Please amend the RFC row so the two agree.
  • The test name test_the_closed_list_is_the_rfcs_eighteen could become test_the_closed_list_has_eighteen_ops.
  • When a caller closes or renames its own session, the slot can be gone by the time the wrapper classifies it, so caller reads other. Minor, but worth a sentence in the spec row.

@iamwhatever
iamwhatever merged commit 3f63700 into main Oct 20, 2026
105 checks passed
@iamwhatever
iamwhatever deleted the feat/21270-session-control-calls branch October 20, 2026 00:56
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 20, 2026
@buluoray buluoray mentioned this pull request Oct 20, 2026
5 tasks done
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.

4 participants