Skip to content

Unfiltered SDK stops enter E2E native-session coverage accounting #5271

Closed

Description

@Trecek

Fix target and dependency — mandatory routing

Repository: TalonT-Org/AutoSkillit.
Fix PR base branch: impl-issue-5233-20261008-implementation, the branch of parent PR #5255.
Required baseline: published 93457f16ecc30249799c02084c20f41d9cd88455 or a descendant, containing ownership repair #5269 and develop's tracker fix #5268.

Open this remediation PR against the parent feature branch, not develop. scripts/e2e/e2e_sessions.py and the implementation pipeline collector are not on develop yet. This is an intentional stacked dependency. #5269 is already merged; do not base on its old fix branch or reimplement its ownership repair. After this follow-up merges into #5255, integrate any independent runtime fix from develop and commission the resulting exact parent head.

Defect and measured consequence

The E2E hook installer subscribes to all SubagentStart/SubagentStop events without an agent-type matcher. The collector groups every captured callback into native-agent lifecycle and transcript coverage accounting. Claude Code also emits stop callbacks for internal helpers that are not spawned native agents. This capture policy admits out-of-scope callbacks that can make coverage incomplete. An unmatched stop creates no interval and does not inflate the measured peak. The exact source of this run's unmatched callback remains unproven; it is consistent with the documented internal-helper behavior.

Run 38431354139, attempt 1 at the required baseline implemented the fixture, received audit GO, opened sandbox PR #4, and passed sandbox CI at 326af5f5825d6b15d0b0bb13733df0e5a495ef25. The full acceptance result nevertheless failed lifecycle coverage. Ownership of the actual branch/claim and eight managed workers was correctly collected; this is a different defect from completed #5267.

Retained reproduction

Artifact e2e-implementation-38431354139-1 includes out/session-events.jsonl, out/session-concurrency.json, root and worker transcripts, and summaries. Download it into .autoskillit/temp/investigate/ with gh run download on the linked run.

Direct retained evidence:

  • Trace record 18: root 123756d6-70db-4319-a2a1-226e765d3d30, SubagentStop, agent a77a7ff9541d002f3, agent_type:"", and a child transcript path that is absent from the retained native inventory.
  • Record 19: the same root receives SessionStart(source="compact") 33 ms later.
  • Root transcript out/transcripts/-workspace-sandbox/123756d6-70db-4319-a2a1-226e765d3d30.jsonl, record 382: automatic compact_boundary, preTokens:194567, postTokens:2221, Claude Code 2.1.280.
  • The full retained root's tool-use blocks contain only AutoSkillit MCP calls; no native Agent or Task launch. The root summary also has no child execution/outcome for a77.
  • The collector creates orphan_end, lifecycle_incomplete, and transcript_unenumerated violations for a77. Observed peak six is not accepted while that completeness check fails.

The supplied run is a retained negative control. Its historical collector failure should not be erased by fabricating a start or transcript or rewriting the raw trace.

SDK semantics and source boundary

Official Claude hook documentation distinguishes spawned-agent callbacks from internal-helper callbacks and documents empty-type matching behavior. A primary Claude Code issue report also describes internal compaction/helper forks with missing starts and unwritten transcript paths on this version family. That report corroborates the pattern; it does not prove the exact internal helper responsible for this particular ID.

The E2E hook installer has no matcher. Existing AutoSkillit native child-outcome registration uses .+ for these events. The collector's interval construction correctly rejects a real orphan stop; the capture scope admits callbacks that are not evidence of an independently launched native session.

The parent inspected the raw trace, compaction record, collector code, existing matcher precedent, and primary documentation. The exact a77 fork kind remains unknown; timing or an empty type alone is not proof of a compaction session.

Required correction and focused tests

Scope native lifecycle capture/accounting to real named Agent-tool/native sessions in the bundled fleet configuration, consistently with the documented SDK behavior and existing observer policy. A capture matcher may be sufficient for the current default-root configuration; verify how a custom main-agent setting affects helper types before choosing the implementation. Do not broadly delete unattributed events from existing traces, invent intervals, weaken coverage checks, or use timestamp proximity alone to exempt events.

Test the installed hook policy against actual built-in/plugin agent-type names and internal blank-type callbacks. Explicitly cover a nonempty custom main-agent setting: SDK internal callbacks can inherit that name, so .+ alone is not a universal discriminator. Either prove and enforce the bundled E2E root's default-agent configuration or handle such typed internal callbacks without exempting genuine native failures. Keep SessionStart/SessionEnd coverage unchanged and preserve existing settings. A genuine named stop without its start/transcript must still fail coverage; real native agents remain counted in peak measurement. Historical pre-fix fixture failures must remain honestly represented. No new event registry or generic observer framework is requested. Run pre-commit run --all-files and the configured task test-local-gate.

Separate acceptance failures and routing

Run 1 also omitted the advertised final reason="implementation_complete"; that is a separate output-contract failure, not proof of this lifecycle cause. Run 2's recipe dispatch/reopen failure is likewise separate and belongs to runtime investigation on develop. This ticket is only the E2E capture/accounting scope correction.

Searches found no exact open duplicate. Classification: bug, recipe:remediation. The new fix can be developed in parallel with the independent runtime fix, but both must be present in #5255's tested head before two fresh accepted commissioning attempts.

Verified commissioning coordination — 2026-10-13

Independent sibling blocker: #5270. These two fixes can be processed in parallel. This ticket's remediation PR must use impl-issue-5233-20261008-implementation as its base; follow the routing section above. Both fixes must be integrated into parent #5255 before the next two acceptance attempts.

Two independent adversarial reviewers examined this issue body. The parent personally checked their cited source and retained evidence, corrected overclaims, and incorporated the required regression safeguards before filing. No source implementation or successful commissioning is claimed by this ticket.

Activity

  1. added
    bugExisting behavior is broken
    recipe:remediationRoute: investigate/decompose before implementation
    in-progressIssue is being actively worked on
    on Oct 13, 2026
  2. added a commit that references this issue on Oct 14, 2026
    d1eaf42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugExisting behavior is brokenin-progressIssue is being actively worked onrecipe:remediationRoute: investigate/decompose before implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions