Skip to content

Preserve descendant limits and settle owned subagent execution - #124

Draft
Ken Chau (kenotron-ms) wants to merge 2 commits into
mainfrom
fix/subagent-depth-lifecycle-20261028
Draft

Ken Chau (kenotron-ms) wants to merge 2 commits into
mainfrom
fix/subagent-depth-lifecycle-20261028

Conversation

@kenotron-ms

@kenotron-ms Ken Chau (kenotron-ms) commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Subagents could reset their delegation depth in a new host session, restart a closed pending handle, and continue executing after close_agent returned. Propagate the effective depth and limit, own one execution task per handle, wait for cancellation to settle, and report unfinished host results as unsuccessful.

The root-install CI fixture also overrode every module in this repository, displacing the public engine's same-named filesystem apply-patch dependency. Limit candidate overrides to the root distribution's five declared same-repository runtime dependencies; keep engine-owned dependencies and the mandatory public create_agent smoke intact.

The canonical coding-agent-loop specification §§7.2–7.3 defines termination, independent child sessions and configurable descendant depth together; these changes preserve that lifecycle contract without changing pipeline traversal or the existing deferred-start interface.

Verification

  • Full loop-agent suite: 587 passed.
  • Regressions cover propagated descendant limits, closed pending handles, concurrent waits without duplicate execution, active close settlement and incomplete/cancelled/failed helper results.
  • An actual Goal verifier assembly exercised helper execution/result consumption, descendant refusal and native cancellation with controlled no-network provider responses. It requires a separate native Core cancellation repair; these runner unit tests alone do not establish that bridge behavior.
  • Independent runtime source review and full-suite rerun completed without findings.
  • CI correction independently reviewed. Original public-binding initialization failed after the overbroad override selected runner apply-patch 0.1.0; corrected installation retains engine-owned filesystem apply-patch 1.0.0 at d71bb95 and the unchanged public create_agent/close smoke passes. uv pip check passes for all 113 installed packages.
  • Touched files formatted. Existing lint findings in the original files remain; no clean lint claim is made.

Checklist

  • nlspec evidence: §§7.2–7.3 cited with surrounding lifecycle context
  • Tests pass in the touched loop-agent module
  • ruff check clean (existing file warnings retained)
  • ruff format --check clean
  • Diff scope matches description
  • No contracts, ledger or extension changes

@kenotron-ms
Ken Chau (kenotron-ms) marked this pull request as draft October 28, 2026 22:03
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.

2 participants