feat(run): basou run codex launcher with pre-spawn orientation channel#150
Merged
Conversation
6da0dd0 to
7a3c37a
Compare
f8ab46b to
dbe6872
Compare
Wrap the Codex CLI as a Basou-tracked session, the twin of `basou run claude-code`. Two grips beyond plain tracking: inject `-c shell_environment_policy.inherit=all` so Codex tool calls can reach `basou` on PATH, and re-render THIS workspace's orientation into ~/.codex/AGENTS.md just before spawn so the interactive Codex auto-loads the current position (correcting the global channel's last-refreshed-workspace semantics). The pre-spawn render is best-effort and surfaces the last-refreshed orientation without re-importing. Generalizes runClaudeCode's lifecycle into a shared runTrackedTool(args, options, ctx, adapter) parametrized by per-tool seams (command resolver, source metadata, arg transform, pre-spawn hook); runClaudeCode / runCodex are thin wrappers, and the run-group subcommand dispatch is shared. Adds the codex-adapter session-source kind (regenerated published JSON Schema) plus codexAdapterMetadata / resolveCodexCommand in core. Claude-code run tests are unchanged and pass; a RunContext.codexChannelPath seam keeps the suite off the real home-global file. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dbe6872 to
4390644
Compare
takashi-matsuyama
added a commit
that referenced
this pull request
Jun 30, 2026
Bump packages/{basou,core,cli,sdk} to 0.30.0 and finalize the CHANGELOG
section. Bundles two already-merged themes:
- Codex adapter (#149/#150): the Codex context channel (basou refresh
renders orientation into ~/.codex/AGENTS.md) and the basou run codex
launcher (pre-spawn re-render + shell_environment_policy.inherit=all +
codex-adapter source kind).
- Y-18 review enforcement (#146/#147/#148): basou review record, the
review-gate verdict in evaluateStopHook, and the opt-in
hook stop --require-review gate.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
basou run codex— wrap the Codex CLI as a Basou-tracked session, the twin ofbasou run claude-code. This is the CLI grip half of the Codex adapter: it gives Codex the cwd-correct orientation delivery and PATH integration thatbasou refresh's static channel (#149) can't guarantee on its own.Two grips beyond plain session tracking:
-c shell_environment_policy.inherit=allso Codex's own tool calls can reachbasouon PATH (thebasou: command not foundfix).~/.codex/AGENTS.md) so the about-to-start interactive Codex auto-loads the current position even when the global channel last reflected a different workspace. Best-effort (a failure never blocks the launch); surfaces the last-refreshed orientation without re-importing.How
runClaudeCode's lifecycle into a sharedrunTrackedTool(args, options, ctx, adapter)parametrized by per-tool seams (command resolver, source metadata, arg transform, pre-spawn hook);runClaudeCode/runCodexare thin wrappers, and the run-group subcommand dispatch + options are shared (addRunOptions/dispatch). Claude-code run behavior is preserved byte-for-byte (its run tests are unchanged and pass).codex-adaptersession-source kind toSessionSourceKindSchema(regenerated published JSON Schema) — distinct from the after-the-factcodex-import.codexAdapterMetadata/resolveCodexCommandto the core codex adapter; thewhich-basedisOnPathprimitive is shared with the claude-code adapter via a newadapters/command-lookupmodule.renderOrientationToCodexChannel, shared withbasou refresh. ARunContext.codexChannelPathseam keeps the suite off the real home-global file.Verification
biome check,lint:lang, and build are green.isOnPath, shared run-options, dropped internal export) are applied; nothing blocked as spec-deviation / design-reversal.🤖 Generated with Claude Code