feat(codex): enable native subagent dispatch - #445
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughCodex dispatch now defaults to ChangesCodex native dispatch
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.trellis/scripts/common/workflow_phase.py:
- Around line 160-171: Update the Codex dispatch parsing in
_trellis/scripts/common/workflow_phase.py_ (lines 160-171) and
_packages/cli/src/templates/trellis/scripts/common/workflow_phase.py_ (lines
160-171) so a non-dictionary codex_cfg explicitly sets mode to "inline" instead
of retaining the "auto" default; preserve the existing handling for valid
dictionary configurations and return mapping.
In @.trellis/spec/cli/backend/platform-integration.md:
- Around line 463-470: Update the existing Codex platform classification and
related Class-2 table to identify Codex as native hook-inject with pull loading
retained only as fallback; remove the statement that its native spawn hook is
unavailable, and revise the class counts and rationale consistently with this
reclassification.
In `@packages/cli/src/templates/codex/hooks.json`:
- Around line 14-24: Update the SubagentStart matcher to use an exact anchored
regular expression matching only trellis-implement, trellis-check, or
trellis-research, preventing names with extra suffixes from triggering the hook.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5ee2f69f-bb3d-4190-b4a7-a82deff36ed2
📒 Files selected for processing (28)
.trellis/config.yaml.trellis/scripts/common/active_task.py.trellis/scripts/common/config.py.trellis/scripts/common/task_store.py.trellis/scripts/common/workflow_phase.py.trellis/spec/cli/backend/platform-integration.md.trellis/workflow.mdmarketplacepackages/cli/src/configurators/codex.tspackages/cli/src/configurators/index.tspackages/cli/src/templates/codex/agents/trellis-check.tomlpackages/cli/src/templates/codex/agents/trellis-implement.tomlpackages/cli/src/templates/codex/agents/trellis-research.tomlpackages/cli/src/templates/codex/hooks.jsonpackages/cli/src/templates/shared-hooks/index.tspackages/cli/src/templates/shared-hooks/inject-subagent-context.pypackages/cli/src/templates/shared-hooks/inject-workflow-state.pypackages/cli/src/templates/trellis/config.yamlpackages/cli/src/templates/trellis/scripts/common/active_task.pypackages/cli/src/templates/trellis/scripts/common/config.pypackages/cli/src/templates/trellis/scripts/common/task_store.pypackages/cli/src/templates/trellis/scripts/common/workflow_phase.pypackages/cli/src/templates/trellis/workflow.mdpackages/cli/test/configurators/platforms.test.tspackages/cli/test/regression.test.tspackages/cli/test/templates/codex.test.tspackages/cli/test/templates/shared-hooks.test.tspackages/cli/test/templates/trellis.test.ts
Withdrawn — we'll handle the submodule and verification on our side.
…dfold-ai#448 merge batch Fill gaps left after mindfold-ai#439 (SessionStart language-adaptive notice) and mindfold-ai#445 (Codex native SubagentStart dispatch) already updated platform-integration.md, and cover mindfold-ai#448's five behavior changes: preferOffline removal, `trellis platforms --json`, task.py list/current --json + display_status roll-up, base_branch/stale-branch git helpers, channel spawn --sandbox, and the Pi skills .pi/skills/ -> .agents/skills/ move.
mindfold-ai#445 removed the per-agent [features] multi_agent=false guard (the mindfold-ai#240/mindfold-ai#241 wait_agent-deadlock structural fix), relying on Codex's *default* agents.max_depth=1 to cap sub-agent recursion. That key is global/user-level, not settable inside an individual agent's .toml (confirmed via Codex subagent-config docs referenced in mindfold-ai#444), so pin it explicitly in the project .codex/config.toml Trellis already owns. Project config takes precedence over the user's global config, so an upstream default change or a user's own override can no longer reopen the recursion the mindfold-ai#240/mindfold-ai#241 fix closed.
* feat(codex): enable native subagent dispatch * test(cli): align update workflow assertions * fix(codex): harden native subagent routing * test(cli): align Codex subagent matcher assertions
…dfold-ai#448 merge batch Fill gaps left after mindfold-ai#439 (SessionStart language-adaptive notice) and mindfold-ai#445 (Codex native SubagentStart dispatch) already updated platform-integration.md, and cover mindfold-ai#448's five behavior changes: preferOffline removal, `trellis platforms --json`, task.py list/current --json + display_status roll-up, base_branch/stale-branch git helpers, channel spawn --sandbox, and the Pi skills .pi/skills/ -> .agents/skills/ move.
docs(spec): refresh contracts for mindfold-ai#439/mindfold-ai#445/mindfold-ai#448 merge batch
mindfold-ai#445 removed the per-agent [features] multi_agent=false guard (the mindfold-ai#240/mindfold-ai#241 wait_agent-deadlock structural fix), relying on Codex's *default* agents.max_depth=1 to cap sub-agent recursion. That key is global/user-level, not settable inside an individual agent's .toml (confirmed via Codex subagent-config docs referenced in mindfold-ai#444), so pin it explicitly in the project .codex/config.toml Trellis already owns. Project config takes precedence over the user's global config, so an upstream default change or a user's own override can no longer reopen the recursion the mindfold-ai#240/mindfold-ai#241 fix closed.
Closes #444
Summary
Ready for review. Targeted automated validation and Windows manual tests are complete;
full-suite baseline failures are noted below.
This change enables Trellis to deliver role-specific task context to native
Codex subagents through
SubagentStart. The defaultautomode dispatchessubagents by default, while explicit
inlineexecution remains available andthe child-side pull path remains a fallback.
Motivation
Codex now exposes a role-filtered subagent-start hook, the parent session ID,
and developer-context injection. Trellis currently has only a pull-based
Codex integration, which can make a child agent load main-session workflow
routing and lose its precise task context.
Implemented changes
SubagentStarthook for the three Trellis Codex roles.fallback and inject each role's curated developer context.
explicit
inlineand retainsub-agentas a compatibility alias forauto.collection, and regression coverage.
The generated marketplace native workflow is updated together with the built-in
workflow template. The resolver keeps its existing defaults for every caller;
only the native Codex hook opts out of environment-context and single-session
fallbacks.
Validation
no-task behavior, and non-Trellis agent isolation.
trellis init/trellis updatetemplate consistency.Completed validation:
pnpm lint,pnpm typecheck, and the relevant Python syntax checks pass.including the three native Codex workflow-routing assertions. The native-hook
black-box cases and migration assertions pass.
of the larger CLI regression file has 22 failures out of 346 tests, dominated
by the missing
python3executable and CRLF/LF-sensitive legacy assertions.It is therefore not claimed as a green full-suite result; Linux CI should
provide the final full-suite verification.
together. The marketplace update is committed at
c78392a; the parentrepository records that submodule pointer in
8438c0fd.SubagentStarthooks,default native
autodispatch, strict two-session sentinel isolation,explicit
inline, and the legacysub-agentalias. The current0.6.7tarball passes a version smoke check; re-running the UI scenarios on that
artifact remains recommended before treating manual testing as final-package
evidence. The optional unapproved-hook fallback scenario was not manually
repeated; it is covered by automated tests.
Compatibility
inlineremains available.context through the established pull path.
callers. Only the Codex
SubagentStartpath disables its sole-sessionfallback, preventing cross-session task-context injection.
Summary by CodeRabbit
SubagentStartcontext injection with strict resolver rules and safe child-side fallback when needed.codex.dispatch_mode(autodefault,inlineopt-out,sub-agentalias) and the new context delivery protocol.