◉ANTIGRAVITY LABJP
Articles/Agents & Manager
◈ Agents & Manager/2026-08-17Intermediate

When a Subagent Never Finishes, Look at the Parent's Unapproved Artifacts First

A subagent that runs all night and never returns is usually not the one that is stuck. Here is how I separate a blocked parent from a blocked child using a short log-scanning script, what the official docs say about approvals, and where I stop letting approvals happen automatically.

SubagentsApprovalsLogsIndie developmentAgent operations

Hand the pre-release checks to an agent in the evening, read the results in the morning. As an indie developer maintaining several apps alone, I lean on that rhythm more than I probably should. Split the work into stages, delegate each stage to a subagent, and the whole pass should complete while you sleep.

That morning, the screen still looked alive. The spinner was turning. No errors anywhere. The only clue was the timestamp on the last output: more than thirty minutes old.

I opened the subagent's log and went looking for the failure. Nothing unusual. The model was fine, the tools were fine. Everything was simply waiting.

I had been reading the wrong log. The child was not stuck. The parent was. It took me the better part of half an hour to see that, so what follows is the routine I rebuilt afterwards — the one that tells me in a few minutes which conversation to open, and keeps the next night from stalling the same way.

A healthy child cannot move while the parent is waiting for approval

When a subagent runs on delegation from a parent, the artifacts it produces seem to be handed back to the parent for disposition — that is what I observed in my own setup, not a behavior I could confirm in the official docs. If that parent is sitting behind an approval dialog of its own, the child's request never gets its turn.

The child's log gives you nothing but "waiting." Because it is not an error, timeouts may never fire. The run ends up stalled where nobody notices, and it stays there until morning.

The official subagent docs describe the mechanism: when a subagent's tool call needs authorization, the request "automatically bubbles up to the main UI or subagent panel." Alt+J jumps to the next subagent awaiting approval, and Ctrl+K approves the pending action in place. Since v2.23.0 (October 2026), the sidebar also flags a conversation when one of its subagents is waiting for your approval. So the wait is shown somewhere on screen — but if nobody is looking overnight, that indicator reaches no one.

Shortcuts and indicators move between releases. What I describe here matches the official docs as of November 2026 (app v2.32.x); if your version differs, the keyboard shortcut list is the quickest place to confirm.

Not every stalled turn has this cause. When hooks are involved, the triage order is different, and I wrote that case up separately in 2.6.0 Changed How Hooks Wait. A Triage Order for Turns That Never Finish. What follows happens even when you use no hooks at all.

The first five minutes, before you open any log

Some of the answer is on screen already. This is the order I check things in now:

  1. The sidebar flag: is any conversation marked as waiting? If the parent carries the flag, something underneath it is waiting
  2. Where Alt+J takes you: the first subagent it lands on, and what that subagent is asking for, is your first real clue
  3. The time of the last output: not the spinner, but the last time text or a tool result actually appeared. Thirty quiet minutes means I treat it as waiting
  4. The tail of the parent conversation: is the parent showing a dialog of its own? Miss this and you end up reading a healthy child's log for half an hour

If those four do not settle it, or the tree is too deep to follow by eye, I move to the script below.

Find the stalled conversations from the log instead of by eye

Reading logs by eye stops working the moment your hierarchy goes past two levels. So I run the log through a script that lists every conversation that issued an approval request and never resolved it — and, more usefully, which of them is the root of the jam.

The script assumes each log line carries a conversation identifier (conversation_id), a parent identifier, a log_uri, and a tool name. Those field names are ones I chose to match my own log output — they are not an official published schema. If your logs look different, translate accordingly. What I would like you to take away is the idea: match parent and child by identifier, not by guesswork.

Start by checking which event names actually appear in your own logs. They change between versions.

# types.py - count the event types present in a log
import json, sys, collections
 
c = collections.Counter()
for line in sys.stdin:
    line = line.strip()
    if not line:
        continue
    try:
        ev = json.loads(line)
    except json.JSONDecodeError:
        continue
    c[ev.get("type", "(no type)")] += 1
 
for k, v in c.most_common():
    print(f"{v:>5}  {k}")

Feed those names into the checks in the next script. It records every approval request, drops it when a resolution or a result arrives, and whatever is left is a stall. Then it walks up the parent chain to find the highest conversation that is still waiting, and reports that as the root.

#!/usr/bin/env python3
"""Read stream-json lines and list conversations stalled on approval, plus their root."""
import json, sys
from datetime import datetime, timezone
 
PENDING = {}   # conversation_id -> (time, tool it is waiting on)
LAST    = {}   # conversation_id -> last event time (heartbeats included)
PARENT  = {}   # child conversation_id -> parent conversation_id
LOGURI  = {}   # conversation_id -> log_uri
 
def ts(v):
    return datetime.fromisoformat(v.replace("Z", "+00:00"))
 
for line in sys.stdin:
    line = line.strip()
    if not line:
        continue
    try:
        ev = json.loads(line)
    except json.JSONDecodeError:
        continue    # drop half-written lines; normal while the log is still growing
 
    sub = ev.get("subagent_info") or {}
    cid = sub.get("conversation_id") or ev.get("conversation_id")
    if not cid or "timestamp" not in ev:
        continue
    if sub.get("log_uri"):
        LOGURI[cid] = sub["log_uri"]
    if sub.get("parent_conversation_id"):
        PARENT[cid] = sub["parent_conversation_id"]
 
    t = ts(ev["timestamp"])
    LAST[cid] = t
 
    kind = ev.get("type")
    if kind == "approval_request":
        PENDING[cid] = (t, (ev.get("tool_info") or {}).get("name", "unknown"))
    elif kind in ("approval_resolved", "result"):
        PENDING.pop(cid, None)
 
def root_blocker(cid):
    """Walk up the parents and return the highest conversation still waiting."""
    top, seen = cid, {cid}
    while PARENT.get(top) in PENDING and PARENT[top] not in seen:
        top = PARENT[top]
        seen.add(top)
    return top
 
now = max(LAST.values()) if LAST else datetime.now(timezone.utc)
rows = sorted(
    ((round((now - t).total_seconds()), cid, tool,
      PARENT.get(cid, "-"), root_blocker(cid), LOGURI.get(cid, "-"))
     for cid, (t, tool) in PENDING.items()),
    reverse=True,
)
 
if not rows:
    print("No conversations are stalled on approval")
    sys.exit(0)
 
print(f"{'wait_s':>7}  {'conversation_id':<16} {'tool':<11} {'parent':<16} {'root':<16} log_uri")
for sec, cid, tool, par, root, uri in rows:
    print(f"{sec:>7}  {cid:<16} {tool:<11} {par:<16} {root:<16} {uri}")
 
roots = sorted({r[4] for r in rows})
print("\n-> Open first: " + ", ".join(roots))
sys.exit(1)   # 1 when something is stalled, so a morning job can alert on it

My first version stopped at the list of stalls. I added the root column after a morning when a grandchild was stuck too, and I stood in front of three rows wondering which to open first. Sorting by wait time does not answer that. The root column does: it names one conversation.

I built a log shaped like that morning — parent, child, grandchild — and ran it under Python 3.10.12:

 wait_s  conversation_id  tool        parent           root             log_uri
   2029  conv-parent-01   write_file  -                conv-parent-01   -
   1978  conv-child-a     write_file  conv-parent-01   conv-parent-01   file:///logs/conv-child-a.jsonl
   1940  conv-grand-a1    run_command conv-child-a     conv-parent-01   file:///logs/conv-grand-a1.jsonl

-> Open first: conv-parent-01

Parent at 2,029 seconds, child at 1,978, grandchild at 1,940 — each gap under a minute. The child and grandchild had spent almost their entire wait blocked by the level above them. Exit code: 1.

Then I added a single line resolving only the parent's approval and ran it again:

 wait_s  conversation_id  tool        parent           root             log_uri
   2048  conv-child-a     write_file  conv-parent-01   conv-child-a     file:///logs/conv-child-a.jsonl
   2010  conv-grand-a1    run_command conv-child-a     conv-child-a     file:///logs/conv-grand-a1.jsonl

-> Open first: conv-child-a

This is the part I had wrong. I assumed clearing the parent would let everything flow. It does not: the child's own request is still sitting there. The root simply moves down one level. Only after resolving all three did the script print "No conversations are stalled on approval" and exit 0. Restarting the child alone would not have cleared anything.

You can run this against a log that is still being written. Point it at a copy, or pipe the tail of the file in; the decoder skips a half-written final line rather than aborting. Because the exit code separates 0 from 1, it also drops neatly into a morning job that only notifies you when something is stuck.

Worth noting what the script deliberately ignores. Heartbeat events keep a conversation's last-seen timestamp fresh without moving the work forward — in the log above, the parent sends one at 18:35 while still blocked. "Recent activity" is a poor signal on its own. Only an unresolved approval request counts as a stall here.

One disclosure: I assembled that log myself to match the assumptions above. The numbers come from actually running the script, but they were not captured from a production run of the product.

Decide where to intervene from the symptom

Start with one fact from the official subagent docs: subagents inherit their parent's permission scopes and sandbox settings. If a child cannot do something, the parent's configuration is often where to look.

If the cause is not an approval rule, the steps are simple: clear the dialogs from the root down, and each child continues from where it was waiting. When the stall was nothing more than a queue, that alone gives you back the half hour you lost overnight.

Depth matters too. Since v2.6.0 (August 7, 2026), stopping a subagent also stops everything it spawned, nested subagents and their background tasks included. If stopping reaches that deep, tracing a stall by identifier at each depth is the safer habit.

SymptomWhat the stall scan showsHow to confirmWhere to intervene
Child stalled, parent movingOnly the child appears; root is the child itselfRead the request Alt+J lands onDecide the child's request. Revisit tool permissions
Parent and child stalled togetherBoth appear with close wait times; root is the parentCheck the end of the parent conversation for an open dialogResolve the parent first, then the child
Stalls at grandchild depth or deeperThree or more rows; root points at the topResolve the root, rerun, see whether the root moves downWork from the root down, one level at a time
The same prompt keeps returningStalls appear but wait times stay short and rotateLook for the same tool name repeatingRevisit how your approval rules match
Spinner turns, nothing appears"No conversations are stalled"Check whether the last events are only heartbeatsSuspect something other than approvals: hooks, network

That last row is outside what the script can see. If it reports no stall and the run is still frozen, approvals are not your problem; go to the hook triage article linked earlier.

Three things I used to believe

A turning spinner means work is happening. Spinners and heartbeats can keep going for the entire time a conversation waits on approval. The two things I trust are the time of the last real output and the list of unresolved requests.

Restarting the stuck child will fix it. As the run above shows, if the parent is still waiting, a restarted child waits in the same place — and you have thrown away whatever it had done so far.

Widening the parent's auto-approval will stop the children from stalling. Children inherit the parent's permission scope, so yes, they will stop less often. But you are also handing over, for the whole night, the moments that were supposed to wait for a person. Not stopping and stopping when it matters are different goals.

Where I stop letting approvals happen automatically

Convenience here is bought with a piece of oversight, so I did not make this a single global decision.

ApproachWhat gets done overnightWhat waits for morningGood fit for
Approve everything by handUp to the first approval requestEverythingStages you are delegating for the first time, or whose permission needs you cannot predict
Auto-approve by where output landsWork that stays inside the working directoryAnything leaving it, signing, credentialsRoutine overnight checks and pre-build drafts
Auto-approve everythingAll of itNothing but an after-the-fact reviewDisposable environments you can wipe

I use the middle row. The night gets only what I could throw away and rebuild in the morning. When a stage is hard to classify, I hold it up against that sentence.

The line sits at where the output lands. Anything that stays inside the working directory gets auto-approved: reads and analysis, draft generation, scratch files for comparison. If those break, I throw them away and regenerate.

Working alone, I have no second pair of eyes to catch a bad artifact, so the boundary has to do that job for me. Anything that leaves the repository — signing, distribution, anything touching credentials — I leave for the version of me who shows up in the morning. Finishing overnight feels good, but being able to undo something at 8 a.m. is worth more.

The genuinely hard part is that approval rules often match more broadly than intended. You can define an auto-approval scope carefully and still have the rule let things through that you never meant to include. I learned that the expensive way, and the audit procedure is in The Line I Thought Matched Nothing Was Approving Everything. Confirm what your rules currently permit before you widen anything.

What you hit after the jam clears

Once the root is resolved and things start moving, two problems tend to come next.

The first is the same prompt coming back and stalling the run again. That is usually about how the rule matches, and Antigravity Keeps Asking Permission for the Same Command? Fix the Approval Dialog Loop walks through confirming it.

The second is a question rather than a bug: should the night's work have been split this deep at all? Three levels of subagents means three levels to unwind when they stop. I wrote about deciding that up front in Choosing Between Orchestrator, /swarm, and /run-workflow by the Shape of the Work. My own rule now: a stage that stalls on approval two nights running gets looked at for whether it can be one level shallower.

What to leave in place for tomorrow morning

Three things are enough to keep a stalled morning from turning into a lost one.

  1. Keep the stall scan next to wherever your run logs land. One command in the morning names the conversation to open
  2. Keep the log_uri from your logs. It takes you straight to the stalled child's log instead of hunting for it
  3. Write down your auto-approval scope in terms of where output lands, so you are not re-deciding it every time

Get the location of the stall wrong and you will spend half an hour reading a perfectly healthy log. I did exactly that. Next time, start with the root column.

Tonight, just decide where the stall script will live. Tomorrow morning, opening the root conversation first will change what a stalled morning looks like.

Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

◈ Agents & Manager2026-11-14
The Agent PR I Approved Was Rewritten a Week Later: Counting Which Lines Survive 14 Days with git blame
Agent PRs often sail through review, yet the same lines get rewritten soon after merge. Here is a small script that uses git blame to count how many of a commit's added lines are still there 14 days later, the date-ordering trap that skewed my numbers, and how I decide where to look next.
◈ Agents & Manager2026-11-09
Hunting for a stopped antigravity-preview-05-2026 outside your source code
antigravity-preview-05-2026 stopped on October 5. Replacing it in source is not the whole job: .env files, CI, cron and runbooks can still carry the old name. A one-grep inventory, with an exit code you can wire into CI.
◈ Agents & Manager2026-10-30
I moved the stop conditions for a nightly Antigravity CLI run outside the CLI
A wrapper that gives a nightly agy -p run three outer stop conditions: time, output size and overlap. Seven endings tested with fake agy scripts showed a timeout exiting with 137, and a leftover process holding the lock so every night was skipped. Includes a morning triage table.