Skip to content

[codex] Add runtime abstraction and cc-connect provider#1103

Draft
ashione wants to merge 42 commits into
ValueCell-ai:mainfrom
ashione:feature/runtime-abstraction-cc-connect
Draft

[codex] Add runtime abstraction and cc-connect provider#1103
ashione wants to merge 42 commits into
ValueCell-ai:mainfrom
ashione:feature/runtime-abstraction-cc-connect

Conversation

@ashione

@ashione ashione commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a runtime abstraction layer for ClawX so OpenClaw remains the default runtime while cc-connect can be selected as an optional packaged runtime.

This update completes the cc-connect replacement slice:

  • Bundles both cc-connect and native OpenAI Codex CLI artifacts into app resources; runtime startup no longer depends on global installs, PATH binaries, node_modules postinstall binaries, or app-time downloads.
  • Starts a real ClawX-managed cc-connect process with management and bridge enabled in app.getPath('userData')/runtimes/cc-connect/config.toml.
  • Routes GUI chat through a ClawX cc-connect BridgePlatform adapter and maps replies back to existing chat:message / chat:runtime-event Host events.
  • Keeps OpenAI API key, OpenAI OAuth/Codex, and Ollama provider/model profile sync under the managed cc-connect/Codex home.
  • Routes cron Host APIs to cc-connect Management API when cc-connect is active.
  • Mirrors enabled local skills into the managed Codex home for cc-connect mode.
  • Updates Settings capability flags, docs, README files, packaging scripts, and E2E coverage.

Validation

  • pnpm run typecheck:node
  • pnpm run typecheck:web
  • pnpm exec vitest run tests/unit/cc-connect-runtime-provider.test.ts tests/unit/cc-connect-paths.test.ts tests/unit/codex-paths.test.ts tests/unit/codex-bundle.test.ts tests/unit/cc-connect-skills.test.ts tests/unit/host-services.test.ts tests/unit/runtime-manager.test.ts tests/unit/codex-cli-bridge.test.ts
  • pnpm run bundle:cc-connect:current && pnpm run bundle:codex:current
  • pnpm run comms:replay && pnpm run comms:compare
  • pnpm run build:vite && pnpm exec playwright test tests/e2e/cc-connect-codex-runtime.spec.ts tests/e2e/settings-runtime-selector.spec.ts
  • pnpm exec eslint electron/main/ipc-handlers.ts electron/runtime/cc-connect-bridge-adapter.ts electron/runtime/cc-connect-paths.ts electron/runtime/cc-connect-provider.ts electron/runtime/cc-connect-skills.ts electron/runtime/codex-paths.ts electron/runtime/codex-cli-bridge.ts electron/runtime/types.ts electron/services/cron-api.ts electron/services/skills-api.ts scripts/bundle-codex.mjs scripts/codex-bundle-lib.mjs tests/e2e/cc-connect-codex-runtime.spec.ts tests/unit/cc-connect-paths.test.ts tests/unit/cc-connect-runtime-provider.test.ts tests/unit/cc-connect-skills.test.ts tests/unit/codex-bundle.test.ts tests/unit/codex-paths.test.ts tests/unit/host-services.test.ts tests/fixtures/codex-bundle-api.ts
  • git diff --check
  • build/cc-connect/darwin-arm64/cc-connect --version
  • build/codex/darwin-arm64/bin/codex --version

Note: local full pnpm run lint:check still fails only because this checkout contains nested .claude/worktrees/... directories with unrelated lint errors outside the PR diff. The scoped lint command above covers the files changed by this PR and passes.

Remaining Notes

  • OpenClaw remains the default runtime and rollback path.
  • cc-connect mode now reports chat/session/history/provider/model/cron/skills as supported; channel-specific OpenClaw controls remain unavailable in cc-connect mode.

@ashione ashione requested a review from su8su June 7, 2026 15:48
@ashione ashione requested review from hazeone and vcfgv June 8, 2026 12:29
@ashione ashione force-pushed the feature/runtime-abstraction-cc-connect branch from 75a8efd to a504a8c Compare June 9, 2026 12:12
zuolingxuan and others added 9 commits June 9, 2026 20:21
…action-cc-connect

# Conflicts:
#	electron/services/providers-api.ts
#	package.json
#	pnpm-lock.yaml
Add operation-level runtime capabilities so cc-connect can report native, proxy, and unsupported sub-operations without overstating OpenClaw parity.

Keep OpenClaw as the default runtime, surface cc-connect operation gaps in Settings, and extend OAuth/bundle E2E coverage plus harness specs for replacement-readiness validation.
Send GUI chat through the Codex bridge so cc-connect runtime sessions use Codex as the execution engine.

Persist Codex JSONL tool call and tool output events as ClawX history messages so the chat execution graph can show command/tool relationships.
Default cc-connect Codex execution to ClawX-managed runtime workspaces under userData instead of the ClawX source checkout.

Map OpenClaw agent ids to cc-connect managed workspace directories without inheriting OpenClaw workspace paths, while preserving explicit workDir overrides for diagnostics.
ashione added 5 commits June 14, 2026 00:26
Reuse existing OpenClaw agent/default workspaces when generating cc-connect project work dirs, while falling back to managed cc-connect workspaces for missing paths.

Keep the Codex bridge cwd aligned with the selected main workspace and document the workspace compatibility contract in the runtime architecture docs and harness spec.
Send cc-connect GUI chat through the BridgePlatform adapter instead of invoking CodexCliBridge directly.

Prefer bridge-owned history before falling back to Codex transcript history, and update tests/specs to lock the runtime contract.
Delete CodexCliBridge and its standalone transcript tests so cc-connect runtime state is sourced through BridgePlatform.

Drop Codex transcript session fallback, provider injection hooks, and stale harness references to the deleted bridge.
Remove direct Codex transcript fallback from the cc-connect bridge adapter so sessions and history come only from cc-connect bridge/session state.

Document the invariant that ClawX may only provide Codex bundle/auth/config inputs to cc-connect and must not directly execute Codex or read Codex runtime state.
@ashione

ashione commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@vcfgv cc connect supports PI-Agent as well. You might dive into it and do some research about how to connect to runtime.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant