π€― LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
Deep Review Β· Codex Manual
Deep mode in Codex, end to end. Every spawned agent receives a self-contained prompt.
Runtime contract
Inspect the collaboration tools already exposed in the session before spawning. Use deferred-tool discovery only when the session explicitly says collaboration tools are deferred.
Bind these capabilities from the real schemas:
- spawn
- wait for any completion
- optional explicit close/release
- context inheritance control
- active concurrency limit
Set context inheritance explicitly to none. If inheritance cannot be disabled, disclose weakened independence in the report. If spawning is unavailable, stop and offer light mode.
Define one release(agent) operation from the documented lifecycle:
- completion automatically releases an active slot β no-op;
- a finished agent holds its slot until explicit close β close it;
- slot reuse cannot be determined or achieved β stop and offer light mode.
Do not select the algorithm merely from whether a close verb exists. Slot reuse is the capability that matters.
Group table
Codex packs related dimensions to fit the normal three usable subagent slots:
| Group | Dimensions |
|---|---|
quality |
ai-coding-bad-habits, code-style, reuse-architecture, business-logic, ux |
correctness |
logic, performance, security, compatibility |
release |
release-risk |
process |
workflow, skill-freshness, observability |
Pruning removes dimensions; empty groups disappear. Start release, correctness, and quality
first so the largest evidence passes begin immediately; queue process. Use a fast tier for
process and a balanced tier elsewhere.
Extension-only dimensions form an extras group and join the same queue. Never drop it.
Step 0 β Scope and background
Follow ../scoping.md. Produce {changes}, a β€ 200-word scope summary, and PR
metadata in PR mode.
Step 1 β Select dimensions and references
Apply SKILL.md pruning, detect sibling extension packs, and collect built-in plus extension paths.
Dimension files may route to surface-specific references; agents read only the routes matching the
diff.
Step 2 β Build prompts
For every non-empty group, instantiate ../review-prompt.md with
{dimensions}, {dimension_files}, {scope_summary}, and {changes}. Set the discovered
inheritance control to none.
Step 3 β Run the work queue
Maintain:
pendingWork: not-yet-spawned review, review-retry, verify, and verify-retry itemsactive: spawned work keyed by agent idreportPoolreleaseChecksmissingSourcesworkflowFeedbackneedsContext- verification statistics
Seed pendingWork in this order: release, correctness, quality, process, extras. Fill every
usable slot.
Whenever an agent completes:
- Call
release(agent). - Remove it from
active. - Validate its fenced payload with
bun run .agents/skills/deep-review/scripts/validate-output.ts <review|verify>, passing the response on stdin or through a task-scoped temp file. - On invalid review output, prepend the identical review retry to
pendingWork. On invalid verify output, prepend a retry for the unresolved original ids. - Handle valid output as described below.
- Refill every free slot from
pendingWork.
The loop ends only when active and pendingWork are both empty.
Valid review output
Append missing_sources, release_checks, and workflow_feedback before partitioning findings.
verify: falsefindings βreportPool- verifiable findings β append one verify item using
../verify-prompt.md, including only the required verification addenda - zero verifiable findings β no verify item
Valid verify output
Compare input and output ids one-to-one. Missing, duplicate, or invented ids invalidate those entries; prepend a fresh verify item for unresolved original ids.
- Apply
severity_overrideand the nature/exposure overrides before cross-checking invariants: effective P0 must block release, effective P2 must not, and effectiverelease-riskorexposed_legacyfindings must not be auto-fixes. Only a mismatch in the effective values returns that id to the verify queue. - append verifier
workflow_feedback confirmedβ apply overrides and append toreportPoolfalse_positiveβ statistics onlyneed_more_contextβneedsContext
The main agent never re-verifies a candidate.
Step 4 β Consolidate duplicate roots
After the queue drains, if at least two confirmed findings remain, spawn one fresh agent using
../consolidate-prompt.md. Pass confirmed findings after overrides and
in report order.
Validate with validate-output.ts consolidate. Reject invented ids, self-maps, cycles, or roots
that occur after their duplicates; retry consolidation until valid. Apply the map only after those
checks. Zero or one confirmed finding skips consolidation.
Step 5 β Render
Render strictly per ../report-template.md, including aggregated missing
sources and workflow feedback, optional consolidation, statistics, and PR-mode merge verdict. Run
the pre-send self-check.
Step 6 β Offer the safe batch
When non-empty, use request_user_input once:
"Safe to fix now" has N low-risk findings β apply them all in one pass?
with Fix all / Not now; free text covers partial picks. Apply tests where need_test: true.
Step 7 β Walk remaining decisions
Ask one finding at a time for confirmed can_auto_fix: false items and needsContext, ordered P0 β
P1 β P2 and blocking first. Exclude legacy hand-offs. Skip low-likelihood, non-blocking items on
repeat review unless requested.
Step 8 β Offer legacy hand-off tasks
When legacy hand-offs exist, ask once whether to create all, some, or no LobeHub tasks. Create
nothing before approval. On approval, create them with lh task create and include location, culprit,
scenario, likelihood, and verification evidence.
Notes
- Small diff: β€ 200 lines and β€ 5 files; inline it. Otherwise pass fetch commands.
- PR mode: GitHub URL or unambiguous
PR #123/pr 123/pull request 123; a bare#123is not. - Increasing concurrency may start all four built-in groups together; the same queue algorithm remains valid.