Skip to content

feat: inspect subagent parent and batch facts without message content - #201097

Draft
johan-eilertsen wants to merge 1 commit into
openclaw:mainfrom
johan-eilertsen:feat/subagent-correlation-read-614
Draft

johan-eilertsen wants to merge 1 commit into
openclaw:mainfrom
johan-eilertsen:feat/subagent-correlation-read-614

Conversation

@johan-eilertsen

Copy link
Copy Markdown
Contributor

Related: #201092

What Problem This Solves

A selected subagent wait omits the original parent turn and completion cohort, while its normal label/error output is unsuitable for content-free follow-up. Private-result consumption must not be mistaken for delivery of the parent's visible answer.

User Impact

An opt-in metadataOnly wait returns recorded parent/controller/generation and frozen-batch facts without task/result/error/payload text. Existing requester/controller visibility remains authoritative; optional expectedGenerations only narrows the selection. Missing facts remain unknown, and legacy wait output is unchanged. This does not give plugins a background registry reader or activate incident follow-up.

Why This Change Was Made

Project allowlisted facts through the existing selected-run preparation/consumption path. Compare authorized compact and full owner identities and pin each metadata wait to its original parent/cohort. Report requester custody, transport disposition, admission policy and exact visible-final evidence separately. No new persistence, registry, permission or timer is introduced. Agent-tool owner acceptance is required for the new contract.

Evidence

Bounded execution of the actual tool, projection and identity source uses synthetic controller/registry/I/O seams: nine base failures with two unchanged controls, then 11/11 candidate checks. It is not native authorization, persisted hydration, recovery or host proof. Authored native tests address real persisted-controller negatives and adoption from an unassigned to assigned parent turn; those tests have not run. Independent review found one parent/cohort-selection P2, which was fixed; a fresh review confirmed that correction and no remaining concrete P0-P2 defects.

Formatter, whitespace and TypeScript syntax stripping pass. Draft gates: native subagents-tool and registry/adoption suites, applicable prefix/schema checks, targeted type/lint and exact-head build/CI remain outstanding. The standard command node scripts/run-vitest.mjs src/agents/tools/subagents-tool.test.ts --maxWorkers=1 failed before collection because checkout tsx/dependencies are missing. No dependency install, full local build, CI dispatch/rerun, Gateway change or custom deployment package was made. Native wall time and CI seconds are unavailable. Require source gates before ready/merge; later ordinary release/host activation is separate from source-contract acceptance.

Related: openclaw#201092. Preserve current controller scope and legacy output. Keep ownership, parent/cohort selection, private-input custody and visible-final evidence separate without adding a background reader.

Co-authored-by: johan-eilertsen <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M labels Nov 18, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Nov 18, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR adds optional content-free parent, batch, generation, and delivery facts to selected subagent waits.

Example: Inspect run correlated for parent-turn with ownership generation 1 and rearm generation 2.

  • Before: The wait snapshot includes label/error fields but omits the parent turn and completion batch.
  • After: metadataOnly returns recorded parent and batch facts without message content, while a generation mismatch returns unavailable.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is coherent on source inspection, but native validation is outstanding, required real-behavior proof is absent, and product acceptance remains unresolved.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: An operator cannot correlate a selected child with its parent turn, frozen completion batch, and visible-final evidence using a content-free wait response.
Reason: The proposed capability is distinct from existing wait and plugin listing contracts, but its additional model-facing fields and selection lifetime require an owner decision.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this draft open: it adds a distinct capability absent from current main and is paired with an unresolved feature issue by the same author; no definite introduced bug was found.

Priority: P2
Reviewed head: 011d5dde45a6eeee11df0dd232db95bf9beaa345
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should subagents wait expose metadataOnly and expectedGenerations with parent-turn and frozen-cohort identity pinned throughout a pending read?
  • Recommendation: Approve a bounded contract: Specify the minimum recorded fields and fixed-selection semantics, then assess the implementation against that contract.
  • Why: The source establishes a missing capability, but neither this PR nor its linked issue records human owner acceptance of the new model-facing contract and selection semantics.

Before merge

  • Add real behavior proof - The subagents wait change is supported only by reported execution with synthetic controller, registry, and I/O seams; native hydration and Gateway behavior remain unproven. Provide redacted terminal output or logs showing the changed scenario, removing credentials, IPs, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Complete next step - Contributor: complete the native tool and registry/adoption suites, applicable prefix/schema checks, and targeted type/lint validation on the reviewed head.

Findings

None.

Tests

  • Missing end-to-end proof: Show an authorized metadata-only wait through an isolated Gateway, including content omission and a generation mismatch returning unavailable; the supplied synthetic checks do not establish this shipped path.
Agent review details

How this fits together

The subagents agent tool reads selected native runs through the existing registry preparation and requester/controller scope, then returns status snapshots without consuming completion delivery.

flowchart TD
  A[Agent tool invocation] --> B[Controller scope]
  B --> C[Selected registry preparation]
  C --> D[Authorized snapshot consumption]
  D --> E[Generation and cohort selection]
  E --> F[Content-free projection]
  F --> G[Wait tool response]
Loading

Technical review

Best possible solution:

Accept only an owner-approved minimal projection through the existing scoped wait reader, preserving legacy output and the distinction between consumption and visible delivery.

Do we have a high-confidence way to reproduce the issue?

Source confirms that current main lacks the requested metadata projection; this is a feature request, and no target code or tests were executed during this review.

Is this the best way to solve the issue?

The projection and selection checks fit the existing wait owner without introducing another registry, persistence layer, or authority path, subject to acceptance of the proposed contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a6983ed7eeb7.

Provenance checked

  • Native selected-wait ownership keeps the original intent (6652f7e: The Tasks retirement moved retained native status and waiting behavior to its existing subagent owner instead of preserving a parallel ledger.)
  • Prepared scoped registry reads keeps the original intent (059ac34: Prepared compact facts and selected payload hydration avoid repeated full-registry work while keeping authorization, selection, and presentation together.)
  • Requester consumption versus visible final keeps the original intent (6d7a56d: Requester transcript custody must be recorded independently from external delivery and any separately owed visible final.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Verified introduced changes: The pinned introduction diff adds two optional tool parameters, a recorded-fact projection, selection predicates, documentation, and focused tests; base-only changes are outside this PR. (src/agents/tools/subagents-tool.ts:70, 011d5dde45a6)
  • Current main lacks the requested mode: Current main retains the ordinary wait schema and mapRun output, which include label/error fields but omit requester-turn, frozen-batch, and visible-final correlation. (src/agents/tools/subagents-tool.ts:57, a6983ed7eeb7)
  • Existing scope remains authoritative: Metadata reads retain readCurrentScope visibility, compare compact/full execution identities, and apply expected generations only as additional selection predicates. (src/agents/tools/subagents-tool.ts:435, 011d5dde45a6)
  • Projection separates delivery facts: The allowlisted response distinguishes requester consumption from requesterVisibleFinal and excludes task, label, error, private input, and delivery payload text. (src/agents/tools/subagent-correlation.ts:4, 011d5dde45a6)
  • Unresolved paired feature request: [Feature Request]: content-free parent and completion-batch facts in selected subagent waits #201092 is open, authored by the same contributor, and explicitly requests acceptance of this bounded tool contract; its discussion contains no human maintainer approval.
  • Supplied validation is explicitly limited: The complete PR body reports synthetic controller/registry/I/O execution, states native suites did not run, and supplies no shipped-entry-point output; comments and reviews add no qualifying behavioral evidence or owner approval. (011d5dde45a6)

PR surface

Source +156, Tests +282, Docs +21. Total +459 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 160 4 +156
Tests 2 282 0 +282
Docs 1 21 0 +21
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 463 4 +459

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Model-facing parameters 2 optional additions metadataOnly and expectedGenerations extend the existing wait contract without adding configuration or persisted fields.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded observability feature with a concrete missing contract and no demonstrated urgent runtime failure.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 18, 2026, 4:05 AM ET / 09:05 UTC.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant