Skip to content

fix: preserve member identity through dispatch and continuation - #11018

Merged
bolichen97 merged 1 commit into
mainfrom
fix/member-runtime-lifecycle
Sep 17, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/member-runtime-lifecycle

Conversation

@Zedmor

@Zedmor Zedmor commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Private member work can lose its tools or identity between delegation, completion callbacks and gateway restart. A new worker may have member metadata but no protected private-memory assignment. A continuation can resume its native session yet fail memory calls, inherit the conductor's template, or reject the directory it already uses. Members can refuse to reopen a running conversation. Creation must not let a private caller assign work to another member's memory.

Why it matters

Owners need to continue the same task with the same private memory. They need to reopen member conversations and see when delegated workers are still busy. A failed identity check must not silently select global memory.

What changed (motivation → approach → change)

Keep member identity and agent selection in protected records, separate from editable history. Dispatch publishes the selected namespace and private assignment before execution. A named crew stays distinct from its template through admission, queueing and allocation. A template override changes one turn, not the member identity restored by continuation. Failed-run retries retain the known member. Private callers create only same-store workers; Global callers retain member assignment. Creation checks the canonical caller key before allocation and rechecks its live identity after awaited preparation. Continuation retains the original selection, app owner, project and memory mode. Agent switches save a revision-checked choice; failed writes, cancellation and failed private grants restore the committed choice before releasing locks. Restored conversations use that record. Private tools still require process, session and store proof.

Effort receipts resolve the same member/template namespace as execution; unknown identity omits a verdict instead of guessing. The run list shows the crew name when no explicit template was supplied, so retaining an empty override does not erase the member label.

Make required KAS tools ready before prompting. Carry compatible managed-server declarations in the session request with their trusted gateway and caller identity. Wait for connection and permitted tool exposure without resetting the full MCP report. Session-owned status frames retain external server failures, authorization needs and reconnect state. Failed fresh sessions are terminated; failed resumes preserve native history. New conversation creation waits for memory startup within the existing grace period.

Keep member conversations accessible while work runs. Members can reopen a verified live assignment, including approval waits, and see child-only activity. Channel commands pass the parent's verified memory store into admission. Continuing in the current pool default omits a redundant directory override; a different recorded directory still passes current directory policy. Refusal text distinguishes a linked session from a mismatched private assignment; running alone is not an error. Supporting shell and private-filesystem fixes preserve existing safety checks.

Changed area Before After
Delegation: mcp_tools/spawn.py, dashboard/session_control.py, session_allocation.py 🟥 Birth history could precede private assignment; a private creator could choose another store. 🟨 Advertise crew, validate private delegation, publish selection and pin assignment before birth metadata; drain cancelled writes.
Continuation: subagent_manager/run.py, subagent_manager/continuation.py, subagent_manager/admission/pump.py, subagent_persistence.py, subagent.py, dashboard/token_auth.py 🟥 A new run could lose caller recognition, template, app scope or project. 🟨 Retain protected identity and allocation-owned selection; validate caller policy and active continuation identity.
Channel commands: messaging/commands.py 🟥 The member was inherited without its memory store. 🟨 Resolve the recorded store off-loop; refuse unreadable or mismatched bindings before dispatch.
Selection: config/loader.py, session.py, session_agent_selection.py, dashboard chat paths 🟥 Discovery, delayed writers or partial persistence could split the chosen identity. 🟨 Preserve the committed choice through switch failure and restoration; private admission remains independent.
KAS tools: acp/runtime.py, acp/kas_agents.py, acp/mcp_session_report.py 🟥 Prompts could precede tools; reports could omit external servers. 🟨 Supply managed servers with trusted identity, wait for required tools and retain the full report.
Members: MembersPage.tsx, website/src/i18n, dashboard/handlers/members.py 🟥 Running DMs refused reopening; an idle parent could hide child work. 🟨 Reopen verified assignments and distinguish child activity from the member's own turn.
Shell checks: security/shell_normalizer.py 🟥 Newlines could merge commands and falsely deny audit scripts. 🟨 Preserve command boundaries and real self-protection denials.
Private filesystem: sandbox.py, platform_compat.py 🟥 Disappearing temporary files or an absent libc wrapper could block private startup. 🟨 Retry complete hardlink scans within a fixed budget and use the atomic Linux syscall fallback on supported architectures.

🟩 added · 🟨 changed · 🟥 removed · 🟦 unchanged

Owning docs/system-specs/, docs/architecture/mcp.md and packaged src/kiro_crew/docs/configuration.md document behavior and refusal paths. Supporting context.py, agent.py, agent_capabilities.py, agent_state.py, provider and session-map changes carry the same identity through context preparation and allocation.

Tests

Candidate 2597b4e124c1ae73b866bc631cd5c0102e44442e, one commit based on main 2a138cc4cc388446108196c1d6735d14a8a3d1d2. The rebase preserves the reviewed member fixes and original author. Its sole conflict was a Windows pod fixture: it retains both IS_LINUX=False and upstream's Task Scheduler probe stub. git range-diff confirms the rest of the patch is unchanged.

  • 1,247 backend tests passed across twelve modules covering member dispatch, private-memory ownership, live DM reopening, protected selection, continuation after restart, persistence, KAS tools, ACP readiness and the resolved Windows fixture.
  • Session-control regressions cover cross-private/private-to-Global refusal, explicit/inherited same-store creation, unreadable identities and caller changes during awaited authorization. Real-manager tests cover named-member admission, queueing, one-turn template overrides and restart continuation. Providers are doubled; member configuration, allocation and protected selection are real.
  • 111 Members UI tests, the TypeScript/Vite production build, TypeScript checking and 37 static/documentation checks passed on this candidate. Backend checks include full isort, flake8 and mypy (1,616 source files), baseline-aware Black and subprocess encoding.
  • A focused independent rebase review returned No findings, checking the conflict, upstream intersections, unchanged blobs and model-picker integration. The complete hosted GPT and Opus reviews on the preceding 743ac744 also returned No findings. They are retained evidence, not relabeled as reviews of this SHA.

On 743ac744, all four Linux and eight Windows backend shards, frontend shards, E2E, static checks, Coverage Combine and Coverage Gate passed. The two on-demand macOS shards failed six provider-reaping cases and five invalid-byte pathname fixtures; all affected files match that head's base. The ledger count failure did not recur, which does not prove its root cause fixed.

The separate Darwin repair #11491 remains unmerged. Its native run on 7ea8a011 eliminated all six provider-reaping failures; its remaining macOS failures are the five pathname fixtures. Its Linux failure is the Windows pod fixture corrected on this base. The pathname failures remain reported upstream. No unmerged upstream repair, relaxed assertion, additional skip or longer timeout is included here. Fresh hosted checks and reviews must validate this rebased candidate; all-checks-green is not yet claimed.

Test floors in conftest.py and test/conftest.py isolate filesystem and model state; the formatted default-model test leaves .github/black-baseline.txt.

Manual verification

Current private-delegation tests use real slots, protected bindings and persisted history with simulated providers. No real private memories or live gateway settings were used.

The original author supplied authenticated real KAS create/load evidence with public CLI 2.21.4 through a normally installed 0ddf13b5a725e9bd894ac985e6b65d4a9147188f wheel. A fresh process resumed the same native session after the original process stopped; both phases reached managed-server connection and tool exposure, with zero model prompts. ACP tree c4baa15ea5adb1fab98fbca253ddececb06c7ed7 was byte-identical to 0bf8d2263a9e. The current ACP tree also includes upstream scratch-boundary and owner-marker handling changes; the earlier native probe is not whole-tree proof of this candidate. Wheel SHA-256: aef2970625fbe5051e707bf2bd9a35e1a38cd9ff1b9a59c9a3f8473c584df357. The author checked 4,351 installed package files against the wheel and source/assets. Author evidence. This is author-supplied transport/readiness proof, not independently rerun here or a new private execution proof. Native Windows/macOS were not run locally.

The initial same-runtime load probe timed out on tool exposure and remains recorded. The passing fresh-runtime load follows the production AcpProvider._start_kiro_runtime_impl lifecycle.

Historical evidence from the installed af24043d9767 build remains historical: 84 orchestration audit checks with public CLI 2.21.4 on Linux; three accepted/done/pass member tasks; reports of 109 tests passed and one slow-test skip; separate private stores; explicit-project worker recall and same-conversation continuation after gateway restart. Normal approvals were supervised. An initial brief incorrectly prohibited fresh-spawn cwd and failed imports; the corrected assignment supplied it. Memory used keyword mode, not an embedding-ranking or consolidation test. Older real CLI 2.18.0 probes covered allowlists, exclusions and missing executables; CLI 2.20.0 separately reported client origin for explicit injection. These are not new tests of this candidate.

Compatibility limits: managed declarations whose fields cannot cross session transport (disabledTools, timeout, registry metadata) remain in the agent definition. CLI versions without origin metadata cannot safely admit them. CLI 2.19 remains untested. Protected selection records remain for a conversation key's lifetime, including after transcript deletion.

Accepted upgrade limit / release-note handoff: pre-upgrade protected run records missing app ownership return resume_failed after registry eviction or gateway restart. Start a fresh conversation; transcript files are not deleted. Still-registered original runs retain their existing ownership fallback. The maintainer explicitly accepted this limit and authorized the same-store delegation fix in the decision record. The release PR that ships this change should disclose it; this feature PR does not edit shipped changelog sections or infer missing ownership.

The author reported a separate background-consolidation refusal in an earlier isolated run. A clean-main runtime reproduction and embedding-quality verification remain absent; direct persistence/recall do not prove those paths.

The unchanged syscall helper passed a real glibc 2.26/x86_64 probe in an official Amazon Linux 2 container: libc lacked renameat2, the raw syscall renamed successfully, and EEXIST preserved both the destination inode/content and the source. Python 3.7.16 served as the helper harness, not application boot. Compatibility evidence.

A credential-free container with SHA-256-verified public CLI 2.22.0 refused both supported auth modes before ACP initialization because login was absent. No host home, credentials, private memory or model prompts were used. That attempt remains inconclusive; the authenticated author evidence above supplies create/load proof. Evidence request.

The base includes the ledger repair and PR #11442, which fixes the inherited Fargate protocol failure. No unrelated cloud or macOS process-control fix is folded into this patch.

Screenshots / video

Historical captures from installed af24043d9767, retained as prior evidence, not relabeled as current-head screenshots. Members source is unchanged by the authorization patch. “Operator intervention: none” refers to corrective team assignments; normal approvals were supervised. Account counters were redacted by the author.

Members reopened with Delegated work running during private worker execution

Conductor report with accepted tasks and separate private-note retrieval

Related Issues

no linked issue: fixes member execution failures reproduced during the original workflow and review.

Pattern harvest

Rule candidate: review-prompt

Pattern: Preserve protected continuation identity, authorize a child before allocating it, and recheck mutable caller identity after awaited preparation.

Checklist

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

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 15, 2026
@Zedmor

Zedmor commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Intent: Let a conductor reliably dispatch work to named members, receive completion callbacks, and continue their conversations with the original template and private memory. Keep member conversations accessible and their working status accurate while delegated work runs.
Not a goal: Add a task board, change quota or permission policy, or implement #10175.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

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

Design-Verdict: CONCERNS

One 9,400-line commit couples independent fixes — shell-gate boundaries, glibc renameat2 fallback, sandbox retry, KAS readiness — to the member-identity change; any regression reverts all of them.

Watch

  • The PR table itself splits eight "Changed areas" spanning security, platform-compat, and ACP readiness, yet ships them as one commit: a fault in any area forces a revert that also removes the false-denial fix ("Newlines could merge commands and falsely deny audit scripts") and the Amazon Linux 2 startup fix, and bisection can only land on the whole patch.
    Clears when: the shell-normalizer, sandbox-retry and renameat2 hunks land as their own PRs, or a human explicitly accepts the coupled revert.
  • The accepted one-way door — "pre-upgrade protected run records missing app ownership return resume_failed after registry eviction or gateway restart" — has no in-product remedy beyond starting a fresh conversation, and only the release PR can disclose it to users.
    Clears when: the release PR's changelog section names the resume_failed limit and its workaround.

[DESIGN-REVIEWED] 2597b4e

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ PASS

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

UX-Verdict: PASS

Verify the roster's green dot on a delegated-only member reads as "busy", not "replying" — the disambiguating label appears only after selecting the member.

Suggestions

  • spawn_task_reply (messaging/commands.py) now surfaces raw UnknownMemoryStore prose to channel users ("memory store 'member-…' is not declared; global memory was not used") — wrap it in task vocabulary with a next step, e.g. "Can't start this task: this member's private memory binding is broken. Fix it in the crew manager."

[UX-REVIEWED] 2597b4e

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 2597b4e124c1ae73b866bc631cd5c0102e44442e and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 2597b4e

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

@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 Sep 15, 2026
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 2597b4e124c1ae73b866bc631cd5c0102e44442e — 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

KAS session start now fails closed on wire semantics grounded in two captured kiro-cli releases, and the docs themselves admit one load-bearing behavior "was not probed".

Not justified as shipped

  • Item 4 — premise risk: every KAS session start (create and resume) now blocks on _kiro/mcp/status / _kiro/tools/didChange snapshots whose meaning rests on "captured released 2.18.0" and "the retained 2.20.0 capture", while the same docstring concedes 2.20.0's "same-name collision behaviour was not probed"; a provenance-less release with a customized managed entry (disabled, disabledTools, timeout) is newly refused at boot as connected without provenance where it previously started tool-less. This is a core availability path: if the wire claim is wrong on a release users actually run, the whole KAS backend times out at session start.
    Clears when: the author names the released kiro-cli versions the barrier was run against live (including the same-name collision on a provenance-stamping release), or the captured-wire fixtures are linked so the claim is checkable.

What this change ships

Inventory (10 items, capped — the change has more) — 9 justified

Intent: keep a delegated crew member's identity, private memory and tools intact through dispatch, continuation and gateway restart — a FIX, with declared supporting capabilities riding along.

  1. spawn_run now advertises crew, delegating to a member with its private memory — justified
  2. Conversations keep a durable template-vs-member choice surviving restart and same-name member imports — justified
  3. Subagent runs record protected agent/app identity; pre-upgrade runs refuse implicit continuation after restart — justified
  4. KAS sessions wait for required managed MCP tools before the first prompt, failing startup otherwise — premise risk (above)
  5. Managed MCP servers receive the gateway port and session key via session-level declaration — justified
  6. A running member DM can be reopened against its verified live assignment — justified
  7. Member presence shows "Delegated work running" for child-only activity — justified
  8. Session creation refuses cross-store private delegation and mid-flight caller identity changes — justified
  9. Channel spawn/bg pass the parent's recorded store; unreadable bindings stop delegation — justified
  10. Newline-safe shell tokenization, bounded hardlink-scan retries, renameat2 syscall fallback on old glibc — rides along (declared supporting fixes, each with a named startup/false-denial harm)

[FIRST-PRINCIPLES-REVIEWED] 2597b4e

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 2597b4e124c1ae73b866bc631cd5c0102e44442e — this comment is updated in place on each push.

Review details

Both candidates fail falsification:

CANDIDATE 1 (read_run_app refuses legacy version:2 records lacking app): The refusal is deliberate, not a defect. The continuation.py comment states the design intent explicitly — "Writable state is not proof that a legacy run belonged to the dashboard user" — and app-ownership is a real security boundary (app-owned vs person-owned runs). For a run whose protected, un-authorable record predates the app field, ownership is genuinely unprovable, so refusing with a clean, informative error (start a new conversation) rather than assuming person-ownership is the security-safe default the PR is built around. New runs (create_agent_folder(app="")) all carry the key and resolve fine. This is intended behavior with a graceful refusal — no crash, no data loss (result.txt survives) — not a wrong outcome.

CANDIDATE 2 (transiently-unreadable selection file downgrades pinned model to auto): The trigger — a momentary I/O error / permission blip on agent-selections/<digest>.json during _default_session_model — is speculative ("might"/"if"), not a concrete input that occurs in practice. atomic_write (temp+rename) rules out partial-write reads, and the missing-file case returns None (kind "") and falls through to the legacy resolve_effective_model path unchanged. Establishing an observable failure requires assuming a transient fault. Candidate is self-rated low confidence; below the 80 bar.

No new findings survived grounding.

No findings.

[OPUS-REVIEWED] 2597b4e

Verdict parsed from the review's SHA-scoped output markers for commit 2597b4e124c1ae73b866bc631cd5c0102e44442e.

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

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- 🟡 CONCERNS

Which legitimate operations does 2597b4e124c1ae73b866bc631cd5c0102e44442e newly refuse? Updated in place on each push. A script-confirmed regression blocks; the model proposes candidates and never decides a refusal.

Verdict basis: the reviewer's own judgement; no confirmed regression.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 20 classified, 0 newly refused, 20 still allowed.
  • ubuntu-latest (platform posix): 20 classified, 0 newly refused, 20 still allowed.
  • windows-latest (platform windows): 9 classified, 0 newly refused, 9 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: CONCERNS

TIGHTENING: _self_tokens in src/kiro_crew/security/shell_normalizer.py now rewrites every unquoted newline into a ; separator before shlex tokenization -- "shlex treats bare newlines as whitespace, which joins separate commands into one argv. Preserve those boundaries after folding continuations" (if "\n" in command: command = "".join(" ; " if step.active and step.char == "\n" else step.text for step in _iter_shell_chars(command))). The one threat it refuses: a self-kill or self-management command hidden on a later line of a multi-line string, where the eaten newline previously buried it inside the preceding command's argv -- the head tests pin printf x | awk '{print $1}'\npkill -f <product>, P=pkill\n$P -f <name>, and quoted-newline kill targets as denied (test_real_kill_keeps_its_target).

ADJUDICATED: 24 candidates, 0 confirmed newly-refused
No verdicts were handed back for any candidate in this run, so no regression is claimed. The 24 rows in candidates.json probe the boundary the rewrite creates: later lines that newly stand alone on the self-protection floor (kirocrew status, kirocrew cron list, a user-owned pkill -f webpack-dev-server), assignment-then-use across the preserved separator with benign values (LOG=..., PY=.venv/bin/python), heredoc bodies whose data lines now present as commands (the sanctioned git commit -F message-write path, inline python3 - <<'PY'), multi-line for/if/function constructs whose reserved words become standalone segments, quoted newlines that must stay inside their operand (git commit -m, multi-line awk with $1, bash -c '...' payloads), backslash-newline continuation of the sanctioned pytest run, pipelines and gate chains wrapped after | and && where bash continues but the rewrite inserts ;, comment lines, blank/trailing lines, and the Windows spellings below.

PLATFORM COVERAGE: posix -- 14 rows covering the bash-specific shapes the diff's lexing assumes (heredocs, single/double-quoted newlines, \-newline continuations, reserved-word constructs, |/&& line wraps, $KIROCREW_SCRATCH and .venv/bin paths). windows -- 4 rows covering the assumptions the diff makes about newline and escape spelling on the other host: CRLF line endings (the walker must not glue a stray \r into a token), backslashed .venv\Scripts\python.exe paths against the escape-aware walk, a PowerShell backtick continuation (one logical command the new separator cuts in two), and a drive path ending in \ before CRLF (must not be read as a bash continuation). any -- 6 rows of platform-neutral LF-separated git/product-health pairs. Not probed: a lone \r line ending (no LF), which the rewrite leaves un-split so it retains the old joined-argv view; I found no real producer of that spelling to attribute a row to, so it is named here rather than filed. Per-leg verdicts are the deterministic fold's to report, not mine.

UNADJUDICATED: Three tightenings in this PR live outside the shell deny composite, so no candidate row can obtain a verdict on them:

  1. Implicit-continuation template authority -- read_run_agent_selection (src/kiro_crew/subagent_persistence.py) reading subagents/<id>/agent.json. Call path: a dashboard/chat follow-up without an explicit agent -> continuation/selection inheritance -> read_run_agent_selection(agent_id). It refuses (resume_failed: ... supply agent explicitly) when the file is missing, invalid, or a version-1 record naming an agent. Candidate inputs I would have submitted: an implicit follow-up to a run spawned by a pre-upgrade gateway whose run tree has no agent.json; a follow-up after partial pruning of the run directory; a legacy version-1 record.
  2. Continuation app-ownership -- ContinuationCoordinator (src/kiro_crew/subagent_manager/continuation.py) now requires read_run_app(conv_id) to return a string when the original registry record is gone (eviction or gateway restart). read_run_app rejects any identity file that is not version 2 with a string app -- and version-2 files written before this PR carry no app key at all. Candidate input: a dashboard user resuming a conversation started under the previous gateway version, after a restart -- refused with resume_failed: protected app ownership unavailable; start a new conversation.
  3. Session agent-selection binding -- resolve_session_agent_bindings (src/kiro_crew/session_agent_selection.py) refuses resolution when the recorded selection's agent differs from the requested/default agent ("select the agent again"), and refuses every resolution for a session whose selection file is unreadable or invalid. Candidate inputs: a slot whose selected agent was since renamed or removed from config; a changed default_agent under an existing recorded selection; a corrupted selection file.

[SCOPE-REVIEWED] 2597b4e

@Zedmor

Zedmor commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor Author

rebutted — span=3a14e5b65fb2

rebutted — The legacy refusal is intentional. A missing protected app field cannot establish whether the old run belonged to the dashboard user; accepting editable state would manufacture that authority.
After eviction or restart, pre-upgrade runs without that field require a new conversation. Live old runs retain their registered ownership; newly created runs persist it for restart. This is the one-time upgrade limitation, not a claim of transparent legacy continuation.
The owning subagent spec states this at lines74–82. The next description update will state the same limit explicitly; release notes remain owned by the release PR.

@Zedmor

Zedmor commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor Author

rebutted — span=58d31c272e6a

rebutted — Keeping these narrow fixes together is proportional to the requested private-member orchestration bugfix. They address independently reproduced blockers in that workflow: false denial of ordinary audit scripts, private startup on a host without the libc renameat2 wrapper, and disappearing temporary files during private sandbox preparation.
Each has isolated implementation and regression coverage and retains its security refusal boundaries. Splitting them now would require three prerequisite reviews before this integrated repair can work on the tested production-style host. They can still be selectively reverted by their isolated hunks.
This PR contains baseline execution fixes; the separate task-management feature change remains excluded. This is the author’s scope rationale, not a claim that a maintainer has already approved bundling.

@Zedmor

Zedmor commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor Author

rebutted — span=81c4285653d6

rebutted — A slot’s closure does not retire its conversation key: retained history can reopen it and must retain the protected selection. The record is per conversation key, not per turn.
The record also currently survives transcript deletion. Without a retired-key tombstone shared with restore and delayed publication, deleting just this authority file can reintroduce history-based selection when the same key returns.
Retaining the authority is the intentional tradeoff for this dispatch fix. Coordinated key retirement and deletion is a separate lifecycle change; deleting on slot close alone is not a correct cleanup path.

@Zedmor
Zedmor force-pushed the fix/member-runtime-lifecycle branch from 3384274 to d8e02c5 Compare September 15, 2026 15:45
@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 Sep 15, 2026
@Zedmor

Zedmor commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

fixed — span=5981637633a9

fixed in d8e02c5 — Members displays “Delegated work running” when only a child is active; the member’s own active turn keeps its existing status. The driving-session list still describes directly driven sessions.
The member and translation tests cover this state. The attached installed-build screenshot shows the idle parent with its executing private child and the new status; Members source is byte-identical after rebase.

@Zedmor

Zedmor commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

fixed — span=a80b5fa1ab8c

fixed in d8e02c5 — The three assignment-conflict messages now say “Could not save the member assignment. Try again.” or “Could not save the agent selection. Try again.”
The existing HTTP409 and session_rebound code remain unchanged; the user-facing text removes slot terminology.

@Zedmor

Zedmor commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

fixed — span=cafdb61171cb

fixed in d8e02c5 — Removed the unused read_run_agent wrapper. Tests use the existing structured read_run_agent_selection result; no production caller depended on the wrapper.

@Zedmor

Zedmor commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

fixed — span=758d26518290

fixed in d8e02c5 — Default managed declarations are sanitized once and supplied in the session request. Trusted caller-injected declarations retain precedence, and readiness checks connection plus permitted tool exposure.
Real releasedCLI2.18.0 probes passed creation and resume with default declarations, tool allowlists and excluded tools; a missing executable failed despite working same-name global/project servers. CLI2.20.0 separately reported client origin for session injection. The producer and readiness regression set passed601tests.
Required customized entries with fields the session transport cannot carry remain in the agent definition and are refused on older CLIs without provenance. The PR description states that limit; CLI2.19 is untested.

@Zedmor

Zedmor commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

fixed — span=60eee5df9fed

fixed in d8e02c5 — A fresh session/new followed by readiness failure now terminates its native session and MCP children. A session/load readiness failure unregisters only the local handle, preserving retained native history.
Regression coverage exercises error, timeout and cancellation on both paths and preserves a sibling session. The cleanup applies to ordinary readiness failures and compatibility refusals.

@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 Sep 15, 2026
@buluoray

Copy link
Copy Markdown
Contributor

Please address merge conflict. Thanks.

@Zedmor

Zedmor commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

needs-a-decision — span=c021e3dc4eb5

Maintainers: please decide whether to accept one rollback unit for this member-execution fix or require separate prerequisite PRs for shell command boundaries and the atomic Linux rename fallback.
Both supporting fixes were required by the reproduced private-memory workflow. Their production hunks are isolated in security/shell_normalizer.py and platform_compat.py; splitting them is possible, but each resulting candidate needs its own validation. The author's combined validation is not a substitute for maintainer acceptance of that tradeoff.

@Zedmor

Zedmor commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

rebutted — span=8c72ad6ab1e1

The upgrade limitation and remedy are now explicit in the PR description's Compatibility limits and the owning subagent spec: old protected records without app ownership refuse continuation after eviction/restart with resume_failed; start a fresh conversation. Live registered ownership and newly persisted records retain their existing behavior.
A feature PR must not edit CHANGELOG.md under this repository's release policy. The release PR owns that note when this change ships. Requiring an already-written future release entry as a condition for this feature PR is disproportionate; the release-facing text is recorded here without manufacturing missing ownership or editing shipped history.

@Zedmor

Zedmor commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

rebutted — span=dad9ffb4ffea

Confirmed with a real x86_64 glibc2.26 probe through normal platform_compat import, without replacing the selected function: libc had no renameat2 symbol and the selected callable was _build_renameat2_via_syscall.._renameat2.
rename_noreplace published a directory and its payload. A second publish to that occupied destination raised FileExistsError with errno17 (EEXIST); both the existing destination payload and losing source payload were unchanged. The syscall implementation is unchanged from the reviewed head. The missing live-probe evidence is now supplied; other architectures remain covered by their explicit ABI map and fail-closed refusal, not by this x86_64 observation.

@Zedmor

Zedmor commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

needs-a-decision — span=d6b5930ddb4c

The old blanket claim that KAS emits no MCP initialization notifications was contradicted by captured real CLI traffic. Version2.18.0 emitted both _kiro/mcp/status and _kiro/tools/didChange; eight new/load probes covered default setup, allowed/excluded tools and a missing executable. A broken explicitly injected server refused even with working same-name global and project entries. Version2.20.0 separately reported client origin; installed orchestration used2.21.4.
KAS currently accepts any resolvable executable; it has no enforced minimum version. Those observations do not establish behavior for every older release or the untested2.19 release. Maintainers: should KAS introduce a version floor at a confirmed release, or retain protocol-based refusal and the documented compatibility limits? A new minimum-version policy needs that explicit decision; I am not claiming one already exists.

@github-actions github-actions Bot added the readiness: passed Eligible automated validation passed for the current revision label Sep 17, 2026
@bolichen97
bolichen97 merged commit 164d30d into main Sep 17, 2026
89 of 97 checks passed
@bolichen97
bolichen97 deleted the fix/member-runtime-lifecycle branch September 17, 2026 17:18
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 17, 2026
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.

3 participants