Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesExpose configured agent descriptions through agent discovery and add a bounded list of permitted delegation targets to full agent prompts. Review scores
Merge readiness⛔ Blocked before merge - 5 items remain Keep open: current main and the latest release still omit configured descriptions from discovery, and the overlapping PR has not safely superseded this branch. Likely related people: steipete and obviyus are routing candidates based on recent prompt-assembly work; historical introduction remains unverified. Priority: P2 Decision needed
Before merge
Findings
Agent review detailsHow this fits togetherAgent discovery helps coordinating models choose workers from the configured fleet. The requester’s delegation policy filters available agents before their metadata reaches the prompt or agents_list result. flowchart TD
A[Configured agent fleet] --> B[Requester delegation policy]
B --> C[Allowed target metadata]
C --> D[Bounded prompt roster]
C --> E[Agent discovery result]
D --> F[Coordinating model]
E --> F
F --> G[Spawn admission]
Technical reviewBest possible solution: Provide bounded descriptions through authorized discovery first, and add automatic prompt injection only with explicit acceptance of its existing-fleet behavior. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the patch defect: an allowed agent with an arbitrarily long configured description returns that entire value through agents_list. No runtime reproduction or tests were executed during this read-only review. Is this the best way to solve the issue? Unclear: extending authorized discovery is a focused solution, but its description budget is missing and automatic prompt injection is a separate unresolved default-context choice. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ab2e92694e63. Merge-risk optionsMaintainer options:
SecurityNone. EvidenceWhat I checked:
PR surfaceSource +205, Tests +814. Total +1019 across 15 files. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (6 earlier review cycles)
Reviewed October 5, 2026, 6:31 PM ET / 22:31 UTC (Revision 7). |
be11ad2 to
4e60b97
Compare
4e60b97 to
9a963d4
Compare
…nts_list Let the coordinating model see what each allowed spawn target is for. - ResolvedAgentConfig gains description; resolveAgentConfig() reads the authored entry, mirroring name. listAgentEntrySummaries() projects the agent roster (id/name/description) as data. - New delegation-target-roster module resolves the requester's effective allowed spawn targets (effective subagents.allowAgents intersected with configured agents, requester excluded, wildcard expanded) and renders a bounded, sanitized, deterministic "## Delegation Targets" section below the prompt cache boundary, next to the existing delegation guidance. - system-prompt-config resolves the roster in full prompt mode and passes it into the prompt renderer; the stable prefix cache key and bytes above the boundary are unchanged. - agents_list returns an optional per-target description so on-demand discovery matches the injected roster; the tool description now mentions role metadata. Renders only in full mode with sessions_spawn visible and at least one cross-agent target; nothing renders in minimal/none modes, single-agent setups, or self-spawn-only policies. No spawn-policy, schema, migration, doctor, or identity change.
9a963d4 to
2961d27
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
What Problem This Solves
Operators running OpenClaw as a fleet of specialized agents configure cross-agent delegation via
agents.defaults.subagents.allowAgents(or per-agentagents.entries.*.subagents.allowAgents), often as["*"]. The coordinating agent then picks a spawn target viasessions_spawn(agentId=...). Today the model learns that other agents exist but never what they are for — the optional per-agentdescriptionfield (already legal inagents.entries, accepted by the zod schema) is silently dropped byresolveAgentConfig(), and the only model-facing registry (agents_list) returns no description.Solution
ResolvedAgentConfig.description—resolveAgentConfig()now reads the authored entry description, mirroringname; newlistAgentEntrySummaries()projects the roster (id/name/description) as lightweight data. No schema, migration, or doctor change needed (the field was already legal config).## Delegation Targetsprompt section — in full prompt mode, whensessions_spawnis visible and the requester's effectiveallowAgentsadmits at least one configured agent other than itself, a bounded, sanitized, deterministic roster renders below the prompt cache boundary next to existing delegation guidance. Entries renderid(+name) (+description), whitespace-folded to one line, control characters stripped, hard-truncated (name 80 / description 300 chars), capped at 20 entries plus one overflow line (referencingagents_listonly when visible). The stable-prefix cache key and bytes above the boundary are unchanged.agents_listenrichment — the tool result for each allowed target gains an optionaldescription, keeping on-demand discovery consistent with the injected roster; the tool description now mentions role metadata.Why this shape (vs. listing all configured agents)
Upstream enforces
allowAgentsat spawn time (resolveSubagentTargetPolicy), so advertising agents the requester cannot spawn would mislead the model. The roster is derived from the actual allowed set via the same policy function, keeping it truthful. Placement below the cache boundary avoids stable-prefix invalidation; sanitization treats descriptions as data, not instructions.Evidence
Prompt sample, generated through the real code path (
resolveDelegationTargets+buildAgentSystemPrompt, full mode,sessions_spawn+agents_listvisible). Config:{ "agents": { "ownership": "explicit", "defaults": { "subagents": { "allowAgents": ["*"] } }, "entries": { "main": { "name": "Main" }, "research": { "name": "Researcher", "description": "Sources and summarizes current information." }, "writer": { "name": "Writer", "description": "Drafts, edits, and polishes prose." } } } }Rendered prompt (window around the new section; note it sits below
<!-- OPENCLAW_CACHE_BOUNDARY -->, after Project Context):agents_liston the same config returns each allowed target with the authoreddescription(trimmed; omitted when blank).Test evidence (this head, rebased onto current
main):delegation-target-roster.test.ts(19 tests),system-prompt-agent-roster.test.ts(8),agent-scope-config.test.ts,system-prompt-config.test.ts,agents-list-tool.test.ts(9) — all pass.system-prompt.test.ts(175 tests) andsystem-prompt-stability.test.ts(4) pass unchanged.tsgo:coretypecheck clean;check:changed --base upstream/maingreen (format, ratchets, boundary guards).Testing
delegation-target-roster.test.ts(19 tests): allowed-set resolution (explicit/wildcard/defaults fallback/self-exclusion/stale-id pruning), renderer (empty set, deterministic entry shapes, entry cap + conditional overflow line, whitespace/control-char folding, name/description truncation without surrogate splits).system-prompt-agent-roster.test.ts(8 tests): full-mode gating matrix, and a stable-prefix byte-invariance assertion (only delegation targets differ ⇒ identical cache key and identical bytes above the boundary).agent-scope-config.test.ts,system-prompt-config.test.ts,agents-list-tool.test.ts.