feat: depth-free delegation, recoverable subagents, and resilient ChatGPT transport - #253
Conversation
There was a problem hiding this comment.
Concurrent prompt delivery can reject valid messages, return another generation’s result, or remain suspended after lifecycle transitions. Current-conversation forks fail for transient runtime sessions. Background catalog discovery can extend foreground startup waits, and retained subagents can attribute later failures to stale fatal records.
…tGPT transport Delegation: - Remove the subagent depth limit and depth-dependent prompts; bound live subagents per delegation tree with shared slot files instead. - `fork` without `subagent` copies the current conversation; framing messages tell children what they inherited. Delegation guidance lives in the tool descriptions, including what forks and fresh subagents cost. - Merge `steer` into `prompt`: it accepts an ID or value and delivers into a running turn when supported, otherwise as the next turn, and returns once the turn that handled the message ends. - A failed turn, including the first, leaves a live subagent idle and promptable; the error names the subagent, its recorded cause, and how to continue it. - Forks share their parent's prompt-cache key; fresh subagents use their own. Observability: - Fatal error records carry the typed provider failure. - Forward provider retry observers through Kit's session wrappers, so retries reach loop observers and `~/.kit/errors/<session>/retries.jsonl`. - Compose spill markers name the omitted byte range and the artifact offset to read it from. ChatGPT transport: - Use agentkit-provider-openai 0.10.12 (progress-based stall detection, fresh-socket resends including after visible output with supersession, cache-key routing) and agentkit-tool-compose 0.10.12 with runlet 0.6.1. - Discover the context window in the background with retries instead of blocking session start; accept re-authentication to the same account.
a27d0c5 to
036bf3a
Compare
There was a problem hiding this comment.
No new findings in the scoped update. Six prior findings remain active: idle delivery can lose admission races; injected callers can receive another generation’s output or miss their generation’s failure; retirement and fork release can leave delivery waiters suspended; current-conversation forks cannot inherit transient run-N parents; foreground catalog requests can exceed their deadline while awaiting background initialization; and failed turns can report an earlier turn’s fatal cause.
…ostics
- Admit idle deliveries atomically: a session another caller is using,
starting, forking or has advanced hands the prompt back unsent, and
`prompt` re-checks state instead of failing.
- Record each finished generation's outcome and output so callers whose
message was injected receive that generation's result, not a later one.
- Wake delivery waiters on child-exit retirement and fork-reservation
release.
- Fork the current conversation from in-memory `run-N` sessions: transient
runs record their transcript, including compaction rewrites.
- Bound the foreground model-catalog lookup as a whole, so it does not wait
out background context discovery.
- Report a fatal cause only when it was recorded during the failing turn.
- Accept `{ id }` for `prompt`'s subagent, matching `close`.
Summary
Makes delegation independent of nesting depth and cheaper to steer, keeps subagents recoverable when a turn fails, makes provider failures and retries diagnosable, and moves ChatGPT subscription inference to the hardened WebSocket transport in agentkit-provider-openai 0.10.12.
Delegation
KIT_SUBAGENT_TREE_SLOTS.forkwithoutsubagentcopies the caller's conversation. The session id is never put in the model's context. Continuation metadata in the copied transcript is re-bound to the new session rather than stripped.prompttool.steeris merged intoprompt, which accepts a subagent id or value.subagentorfork, leaves a live child idle with its conversation and edits intact. Only a dead child process is retired. The error names the subagent and the cause from its fatal log, and says how to continue it.session-id, so their first request reuses the parent's cached prefix. Fresh subagents use their own.Observability
~/.kit/errors/<session>/retries.jsonl.artifactoffset to read it from.ChatGPT transport
session_binding_rejects_generation_changeis replaced bycredential_binding_accepts_reauthentication_but_rejects_account_changes.Known test issue
Locally, a few ACP tests that list sessions can time out. Listing reads every legacy transcript stored flat in the real
~/.kit/sessionsto find its workspace, and on a machine with many of them that takes longer than the tests allow. This is pre-existing and not changed here; CI starts from a cleanHOME.