Skip to content

Commit bb46b79

Browse files
authored
refactor: internalize OpenClaw agent runtime (#85341)
* refactor: extract agent core package Introduce packages/agent-core as the OpenClaw-owned home for reusable agent loop, harness, session, prompt, and runtime dependency contracts. * refactor: extract shared llm runtime Move provider model registries, stream wrappers, OAuth helpers, and LLM utilities into src/llm with plugin-sdk barrels instead of depending on the old embedded runtime layout. * refactor: remove pi runtime internals Rename remaining Pi-shaped agent surfaces to OpenClaw agent runtime names, delete obsolete Pi docs and package graph checks, and add the third-party notice for incorporated code. * refactor: tighten agent session runtime Make agent-core/runtime dependencies explicit, consolidate compaction and session transcript helpers, and move model/session helpers behind OpenClaw-owned contracts. * refactor: remove static model and pi auth paths Drop static model catalogs and Pi auth bridges, move model/provider facts to manifest-owned runtime contracts, and harden internal embedded-agent utilities. * refactor: remove legacy provider compat paths * docs: remove agent parity notes * fix: skip provider wildcard metadata parsing * refactor: share session extension sdk loading * refactor: inline acpx proxy error formatter * refactor: fold edit recovery into edit tool * fix: accept extension batch separator * test: align startup provider plugin expectations * fix: restore provider-scoped release discovery * test: align static asset packaging expectations * fix: run static provider catalogs during scoped discovery * fix: add provider entry catalogs for scoped live discovery * fix: load lightweight provider catalog entries * fix: refresh provider-scoped plugin metadata * fix: keep provider catalog entries on release live path * fix: keep static manifest models in release live checks * fix: harden release model discovery * fix: reduce OpenAI live cache probe reasoning * fix: disable OpenAI cache probe reasoning * ci: extend OpenAI gateway live timeout * fix: extend live gateway model budget * fix: stabilize release validation regressions * fix: honor provider aliases in model rows * fix: stabilize release validation lanes * fix: stabilize release memory qa * ci: stabilize release validation lanes * ci: prefer ipv4 for live docker node calls * fix: restore shared tool-call stream wrapper * ci: remove legacy pi test shard alias * fix: clean up embedded agent test drift * fix: stabilize runtime alias status * fix: clean up embedded agent ci drift * fix: restore release ci invariants * fix: clean up post-rebase runtime drift * fix: restore release ci checks * fix: restore release ci after rebase * fix: remove stale pi runtime path * test: align compaction runtime expectations * test: update plugin prerelease expectations * fix: handle claude live tool approvals * fix: stabilize release validation gates * fix: finish agent runtime import * test: finish post-rebase agent runtime mocks * fix: keep codex compaction native * fix: stabilize codex app-server hook tests * test: isolate codex diagnostic active run * test: remove codex diagnostic completion race # Conflicts: # extensions/codex/src/app-server/run-attempt.test.ts * ci: fix full release manifest performance run id * refactor: narrow llm plugin sdk boundary * chore: drop generated google boundary stamps * fix: repair rebase fallout * fix: clean up rebased runtime references * fix: decode codex jwt payloads as base64url * fix: preserve shipped pi runtime alias * fix: add scoped sdk virtual modules * fix: decode llm codex oauth jwt as base64url * fix: avoid stale vertex adc negative cache * fix: harden tool arg decoding and codeql path * fix: keep vertex adc negative checks live * refactor: consolidate codex jwt and edit helpers * fix: await codex oauth node runtime imports * fix: preserve sdk tool and notice contracts * fix: preserve shipped compat config boundaries * fix: align codex oauth callback host * fix: terminate agent-core loop streams on failure * fix: keep codex oauth callback alive during fallback * ci: include session tools in critical codeql scans * fix: keep Cloudflare Anthropic provider auth header * docs: redirect legacy pi runtime pages * fix: honor bundled web provider compat discovery * fix: protect session output spill files * fix: keep legacy agent dir env blocked * fix: contain auto-discovered skill symlinks * fix: harden agent core sdk proxy surfaces * fix: restore approval reaction sdk compat * fix: keep live docker runs bounded * fix: keep codex oauth redirect host aligned * fix: resolve post-rebase agent runtime drift * fix: redact anthropic oauth parse failures * fix: preserve responses strict tool shaping * fix: repair agent runtime rebase cleanup * docs: redirect retired parity pages * fix: bound auto-discovered resources to roots * fix: repair post-rebase agent test drift * fix: preserve bundled provider allowlist migration * fix: preserve manifest-owned provider aliases * fix: declare photon image dependency * fix: keep provider headers out of proxy body * fix: preserve shipped env aliases * fix: refresh control ui i18n generated state * fix: quote read fallback paths * fix: preview edits through configured backend * test: satisfy core test typecheck * fix: preserve ZAI usage auth fallback * test: repair codex diagnostic test * fix: repair agent runtime rebase drift * test: finish embedded runner import rename * fix: repair agent runtime rebase integrations * test: align compaction oauth fallback expectations * fix: allow sdk-auth session models * fix: update doctor tool schema import * fix: preserve bedrock plugin region * fix: stream harmony-like prose immediately * ci: include session runtime in codeql shards * fix: repair latest rebase integrations * fix: honor explicit codex websocket transport * fix: keep openai-compatible credentials provider-scoped * fix: refresh sdk api baseline after rebase * fix: route cli runtime aliases through openclaw harness * test: rename stale harness mock expectation * test: rename embedded agent overflow calls * test: clean embedded auth test wording * test: use openclaw stream types in deepinfra cache test * fix: refresh sdk api baseline on latest main * fix: honor bundled discovery compat allowlists * fix: refresh sdk api baseline after latest rebase * fix: remove stale rebase imports * test: rename stale model catalog mock * test: mock renamed doctor runtime modules * fix: map canonical kimi env auth * fix: use internal model registry in bench script * fix: migrate deepinfra provider catalog entry * fix: enforce builtin tool suppression * fix: route compaction auth and proxy payloads safely * refactor: prune unused llm registry leftovers * test: update codex hooks session import * test: fix model picker ci coverage * test: align model picker auth mock types
1 parent 99b27cd commit bb46b79

1,969 files changed

Lines changed: 69865 additions & 25345 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/codeql/codeql-agent-runtime-boundary-critical-quality.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ paths:
1717
- src/acp/control-plane
1818
- src/agents/command
1919
- src/agents/cli-runner
20-
- src/agents/pi-embedded-runner
20+
- src/agents/embedded-agent-runner
21+
- src/agents/sessions
2122
- src/agents/tools
2223
- src/agents/*completion*.ts
2324
- src/agents/*transport*.ts

.github/codeql/codeql-core-auth-secrets-critical-quality.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ paths:
2222
- src/agents/sandbox
2323
- src/agents/sandbox.ts
2424
- src/agents/sandbox-*.ts
25+
- src/agents/sessions/*auth*.ts
26+
- src/agents/sessions/**/*auth*.ts
2527
- src/cron/service/jobs.ts
2628
- src/cron/stagger.ts
2729
- src/gateway/*auth*.ts

.github/codeql/codeql-mcp-process-tool-boundary-critical-security.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ paths:
2424
- src/agents/openclaw-plugin-tools.ts
2525
- src/agents/openclaw-tools.runtime.ts
2626
- src/agents/openclaw-tools.registration.ts
27-
- src/agents/pi-tool-definition-adapter.ts
28-
- src/agents/pi-tools.abort.ts
29-
- src/agents/pi-tools.before-tool-call*.ts
30-
- src/agents/pi-tools.host-edit.ts
31-
- src/agents/pi-tools-parameter-schema.ts
32-
- src/agents/pi-embedded-runner/effective-tool-policy.ts
33-
- src/agents/pi-embedded-runner/tool-name-allowlist.ts
34-
- src/agents/pi-embedded-runner/tool-schema-runtime.ts
27+
- src/agents/agent-tool-definition-adapter.ts
28+
- src/agents/agent-tools.abort.ts
29+
- src/agents/agent-tools.before-tool-call*.ts
30+
- src/agents/agent-tools.read.ts
31+
- src/agents/agent-tools-parameter-schema.ts
32+
- src/agents/sessions/tools/**
33+
- src/agents/embedded-agent-runner/effective-tool-policy.ts
34+
- src/agents/embedded-agent-runner/tool-name-allowlist.ts
35+
- src/agents/embedded-agent-runner/tool-schema-runtime.ts
3536
- src/agents/tools/gateway-tool.ts
3637
- src/agents/tools/message-tool.ts
3738
- src/agents/tools/sessions-send-tool.ts

.github/workflows/codeql-critical-quality.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ on:
7171
- "src/acp/control-plane/**"
7272
- "src/agents/cli-runner/**"
7373
- "src/agents/command/**"
74-
- "src/agents/pi-embedded-runner/**"
74+
- "src/agents/embedded-agent-runner/**"
75+
- "src/agents/sessions/**"
76+
- "src/agents/sessions/tools/**"
7577
- "src/agents/tools/**"
7678
- "src/agents/*completion*.ts"
7779
- "src/agents/*transport*.ts"
@@ -222,7 +224,15 @@ jobs:
222224
network_runtime=true
223225
session_diagnostics=true
224226
;;
225-
src/acp/control-plane/*|src/agents/cli-runner/*|src/agents/command/*|src/agents/pi-embedded-runner/*|src/agents/tools/*|src/agents/*completion*.ts|src/agents/*transport*.ts|src/agents/model-*.ts|src/agents/openclaw-tools*.ts|src/agents/provider-*.ts|src/agents/session*.ts|src/agents/tool-call*.ts|src/auto-reply/reply/agent-runner*.ts|src/auto-reply/reply/commands*.ts|src/auto-reply/reply/directive-handling*.ts|src/auto-reply/reply/dispatch-*.ts|src/auto-reply/reply/get-reply-run*.ts|src/auto-reply/reply/provider-dispatcher*.ts|src/auto-reply/reply/queue*.ts|src/auto-reply/reply/reply-run-registry*.ts|src/auto-reply/reply/session*.ts)
227+
src/agents/sessions/tools/*)
228+
agent=true
229+
mcp_process=true
230+
;;
231+
src/agents/sessions/*auth*.ts|src/agents/sessions/**/*auth*.ts)
232+
agent=true
233+
core_auth_secrets=true
234+
;;
235+
src/acp/control-plane/*|src/agents/cli-runner/*|src/agents/command/*|src/agents/embedded-agent-runner/*|src/agents/sessions/*|src/agents/tools/*|src/agents/*completion*.ts|src/agents/*transport*.ts|src/agents/model-*.ts|src/agents/openclaw-tools*.ts|src/agents/provider-*.ts|src/agents/session*.ts|src/agents/tool-call*.ts|src/auto-reply/reply/agent-runner*.ts|src/auto-reply/reply/commands*.ts|src/auto-reply/reply/directive-handling*.ts|src/auto-reply/reply/dispatch-*.ts|src/auto-reply/reply/get-reply-run*.ts|src/auto-reply/reply/provider-dispatcher*.ts|src/auto-reply/reply/queue*.ts|src/auto-reply/reply/reply-run-registry*.ts|src/auto-reply/reply/session*.ts)
226236
agent=true
227237
;;
228238
src/auto-reply/reply/post-compaction-context.ts|src/auto-reply/reply/queue/*|src/auto-reply/reply/startup-context.ts|src/commands/doctor-session-*.ts|src/commands/session-store-targets.ts|src/commands/sessions*.ts|src/infra/diagnostic-*.ts|src/infra/diagnostics-timeline.ts|src/infra/session-delivery-queue*.ts|src/logging/diagnostic*.ts)

.github/workflows/openclaw-live-and-e2e-checks-reusable.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,6 @@ jobs:
18571857
normalize_provider() {
18581858
local value="${1,,}"
18591859
case "$value" in
1860-
z.ai|z-ai) echo "zai" ;;
18611860
opencode|opencode-go) echo "opencode-go" ;;
18621861
open-router|openrouter) echo "openrouter" ;;
18631862
*) echo "$value" ;;
@@ -1987,15 +1986,15 @@ jobs:
19871986
- suite_id: native-live-src-gateway-profiles-anthropic-opus
19881987
suite_group: native-live-src-gateway-profiles-anthropic
19891988
label: Native live gateway profiles Anthropic Opus
1990-
command: OPENCLAW_LIVE_GATEWAY_PROVIDERS=anthropic OPENCLAW_LIVE_GATEWAY_MODELS=anthropic/claude-opus-4-7 node .release-harness/scripts/test-live-shard.mjs native-live-src-gateway-profiles
1989+
command: OPENCLAW_LIVE_GATEWAY_THINKING=low OPENCLAW_LIVE_GATEWAY_PROVIDERS=anthropic OPENCLAW_LIVE_GATEWAY_MODELS=anthropic/claude-opus-4-7 node .release-harness/scripts/test-live-shard.mjs native-live-src-gateway-profiles
19911990
timeout_minutes: 30
19921991
profile_env_only: false
19931992
advisory: true
19941993
profiles: full
19951994
- suite_id: native-live-src-gateway-profiles-anthropic-sonnet-haiku
19961995
suite_group: native-live-src-gateway-profiles-anthropic
19971996
label: Native live gateway profiles Anthropic Sonnet/Haiku
1998-
command: OPENCLAW_LIVE_GATEWAY_PROVIDERS=anthropic OPENCLAW_LIVE_GATEWAY_MODELS=anthropic/claude-sonnet-4-6,anthropic/claude-haiku-4-5 node .release-harness/scripts/test-live-shard.mjs native-live-src-gateway-profiles
1997+
command: OPENCLAW_LIVE_GATEWAY_THINKING=low OPENCLAW_LIVE_GATEWAY_PROVIDERS=anthropic OPENCLAW_LIVE_GATEWAY_MODELS=anthropic/claude-sonnet-4-6,anthropic/claude-haiku-4-5 node .release-harness/scripts/test-live-shard.mjs native-live-src-gateway-profiles
19991998
timeout_minutes: 30
20001999
profile_env_only: false
20012000
advisory: true
@@ -2295,7 +2294,7 @@ jobs:
22952294
profiles: beta minimum stable full
22962295
- suite_id: live-gateway-anthropic-docker
22972296
label: Docker live gateway Anthropic
2298-
command: OPENCLAW_LIVE_GATEWAY_PROVIDERS=anthropic OPENCLAW_LIVE_GATEWAY_MODELS=anthropic/claude-sonnet-4-6 OPENCLAW_LIVE_GATEWAY_MAX_MODELS=1 OPENCLAW_LIVE_GATEWAY_STEP_TIMEOUT_MS=90000 OPENCLAW_LIVE_GATEWAY_MODEL_TIMEOUT_MS=180000 OPENCLAW_LIVE_DOCKER_REPO_ROOT="$GITHUB_WORKSPACE" timeout --foreground --kill-after=30s 35m bash .release-harness/scripts/test-live-gateway-models-docker.sh
2297+
command: OPENCLAW_LIVE_GATEWAY_THINKING=low OPENCLAW_LIVE_GATEWAY_PROVIDERS=anthropic OPENCLAW_LIVE_GATEWAY_MODELS=anthropic/claude-sonnet-4-6,anthropic/claude-haiku-4-5 OPENCLAW_LIVE_GATEWAY_MAX_MODELS=2 OPENCLAW_LIVE_GATEWAY_STEP_TIMEOUT_MS=90000 OPENCLAW_LIVE_GATEWAY_MODEL_TIMEOUT_MS=600000 OPENCLAW_LIVE_DOCKER_REPO_ROOT="$GITHUB_WORKSPACE" timeout --foreground --kill-after=30s 35m bash .release-harness/scripts/test-live-gateway-models-docker.sh
22992298
timeout_minutes: 40
23002299
profile_env_only: false
23012300
profiles: stable full

.github/workflows/openclaw-release-checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ jobs:
946946
--concurrency "${QA_PARITY_CONCURRENCY}" \
947947
--model "${OPENCLAW_CI_OPENAI_MODEL}" \
948948
--alt-model "openai/gpt-5.5-alt" \
949-
--runtime-pair pi,codex \
949+
--runtime-pair openclaw,codex \
950950
--output-dir ".artifacts/qa-e2e/runtime-parity"
951951
952952
- name: Run standard runtime parity tier
@@ -959,7 +959,7 @@ jobs:
959959
--concurrency "${QA_PARITY_CONCURRENCY}" \
960960
--model "${OPENCLAW_CI_OPENAI_MODEL}" \
961961
--alt-model "openai/gpt-5.5-alt" \
962-
--runtime-pair pi,codex \
962+
--runtime-pair openclaw,codex \
963963
--output-dir ".artifacts/qa-e2e/runtime-parity-standard"
964964
965965
- name: Run soak runtime parity tier
@@ -973,7 +973,7 @@ jobs:
973973
--concurrency "${QA_PARITY_CONCURRENCY}" \
974974
--model "${OPENCLAW_CI_OPENAI_MODEL}" \
975975
--alt-model "openai/gpt-5.5-alt" \
976-
--runtime-pair pi,codex \
976+
--runtime-pair openclaw,codex \
977977
--output-dir ".artifacts/qa-e2e/runtime-parity-soak"
978978
979979
- name: Generate runtime parity report

.github/workflows/qa-live-transports-convex.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ jobs:
289289
--concurrency "${QA_PARITY_CONCURRENCY}" \
290290
--model "${OPENCLAW_CI_OPENAI_MODEL}" \
291291
--alt-model "${OPENCLAW_CI_OPENAI_MODEL}" \
292-
--runtime-pair pi,codex \
292+
--runtime-pair openclaw,codex \
293293
--fast \
294294
--allow-failures \
295295
--output-dir "${output_dir}/runtime-suite"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ Docs: https://docs.openclaw.ai
261261
- Maintainer skills: add `openclaw-landable-bug-sweep` for producing five small, reviewed, CI-green OpenClaw bugfix PRs from issue/PR sweeps.
262262
- Control UI/chat: add search and Load More pagination to the chat session picker, keeping initial session loads bounded while making older conversations reachable. (#85237) Thanks @amknight.
263263
- CLI/onboarding: start classic onboarding when bare `openclaw` runs before an authored config exists, while keeping configured installs on Crestodian. (#72343) Thanks @fuller-stack-dev.
264+
- Agents/runtime: internalize the former Pi agent runtime into OpenClaw, remove legacy package dependencies, and keep Pi-named SDK aliases only as deprecated plugin compatibility.
264265
- Discord: allow configuring a bounded `agentComponents.ttlMs` callback registry lifetime for long-running component workflows, with per-account overrides and a 24-hour cap. (#84189) Thanks @100menotu001.
265266
- xAI/Grok: reuse xAI OAuth auth profiles for Grok `web_search`, thread active-agent auth through web search, add Grok model aliases, and let media providers declare default operation timeouts. (#85182) Thanks @fuller-stack-dev.
266267
- Plugin SDK: add row-level session workflow helpers and deprecate `loadSessionStore` so plugins can read and patch sessions without depending on the legacy whole-store shape. (#84693) Thanks @efpiva.

LICENSE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22+
23+
Third-party notices for incorporated or adapted code are recorded in
24+
THIRD_PARTY_NOTICES.md.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If you want a personal, single-user assistant that feels local, fast, and always
2525

2626
Supported channels include: WhatsApp, Telegram, Slack, Discord, Google Chat, Signal, iMessage, IRC, Microsoft Teams, Matrix, Feishu, LINE, Mattermost, Nextcloud Talk, Nostr, Synology Chat, Tlon, Twitch, Zalo, Zalo Personal, WeChat, QQ, WebChat.
2727

28-
[Website](https://openclaw.ai) · [Docs](https://docs.openclaw.ai) · [Vision](VISION.md) · [DeepWiki](https://deepwiki.com/openclaw/openclaw) · [Getting Started](https://docs.openclaw.ai/start/getting-started) · [Updating](https://docs.openclaw.ai/install/updating) · [Showcase](https://docs.openclaw.ai/start/showcase) · [FAQ](https://docs.openclaw.ai/help/faq) · [Onboarding](https://docs.openclaw.ai/start/wizard) · [Nix](https://github.com/openclaw/nix-openclaw) · [Docker](https://docs.openclaw.ai/install/docker) · [Discord](https://discord.gg/clawd)
28+
[Website](https://openclaw.ai) · [Docs](https://docs.openclaw.ai) · [Vision](VISION.md) · [Third-party notices](THIRD_PARTY_NOTICES.md) · [DeepWiki](https://deepwiki.com/openclaw/openclaw) · [Getting Started](https://docs.openclaw.ai/start/getting-started) · [Updating](https://docs.openclaw.ai/install/updating) · [Showcase](https://docs.openclaw.ai/start/showcase) · [FAQ](https://docs.openclaw.ai/help/faq) · [Onboarding](https://docs.openclaw.ai/start/wizard) · [Nix](https://github.com/openclaw/nix-openclaw) · [Docker](https://docs.openclaw.ai/install/docker) · [Discord](https://discord.gg/clawd)
2929

3030
New install? Start here: [Getting started](https://docs.openclaw.ai/start/getting-started)
3131

@@ -306,7 +306,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines, maintainers, and how to s
306306
AI/vibe-coded PRs welcome! 🤖
307307

308308
Special thanks to [Mario Zechner](https://mariozechner.at/) for his support and for
309-
[pi-mono](https://github.com/badlogic/pi-mono).
309+
[pi-mono](https://github.com/earendil-works/pi-mono).
310310
Special thanks to Adam Doppelt for the lobster.bot domain.
311311

312312
Thanks to all clawtributors:

0 commit comments

Comments
 (0)