Skip to content

docs(adr): ADR-021 — pi turn engine spec + staged OpenClaw retirement (Proposed) - #938

Merged
lilyshen0722 merged 16 commits into
mainfrom
docs/adr-021-pi-engine-openclaw-retirement
Aug 13, 2026
Merged

lilyshen0722 merged 16 commits into
mainfrom
docs/adr-021-pi-engine-openclaw-retirement

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

The wiring spec Sam asked for, and the retirement he called — one ratifiable artifact, because the second is gated on the first being live (house rule: never deprecate until the replacement is live).

Part A — D1 spec grounded in the real SDK (types read from the pinned 0.84.1 dist, not spike memory): noTools: 'all' so a pi session has zero builtins, commonly tools mapped via defineTool onto the one existing dispatcher, session-per-run + dispose() + ephemeral agentDir (first concrete D5 step), caps → same errorKind vocabulary so AgentRun metrics compare across engines, per-manifest engine: 'pi' + PI_ENGINE_ENABLED kill-switch, merge-dark rollout.

Part B — retirement in 5 gated phases: pi soak → install freeze → persona disposition (25 live gateway state dirs, grouped with per-row recommendations) → infra excision (gateway deployment down, _external/clawdbot submodule REMOVED — the five-bump lineage saga ends — provisioner/presets/tool-contract-CI deleted) → docs sweep. Identity continuity absolute: no User rows, memory, or history deleted, ever.

Open decisions flagged for Sam: community-pod re-seating, Phase-3 timing vs GTM, and whether the Scout flag flip waits for a quiet window.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

lilyshen0722 and others added 7 commits August 13, 2026 11:24
…irement (Proposed)

Part A is the D1 spec verified against the real SDK types (0.84.1 pinned):
noTools:'all' + defineTool-wrapped commonly tools onto the existing
dispatcher, session-per-run with dispose(), caps mapped to the same
errorKind vocabulary, per-manifest engine flag + env kill-switch, backend
stays the scheduler. Part B stages the retirement behind the house rule
(replacement live first): freeze → disposition (25 gateway state dirs
grouped, per-row recommendations) → infra excision (gateway down,
submodule REMOVED, provisioner/presets deleted) → docs sweep. Identity
rule 8 throughout: retiring the runtime never deletes users, memory, or
history. Open decisions flagged for ratification.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
…Scout engine swap deferred to appendix

Sam's clarification: pi support means hosted cloud agents (few, heavy,
entitlement-gated, container+PVC isolation — the cloud-codex pattern with
a pi-SDK runner), not the per-user Scout, whose native loop is adequate.
The Scout in-process spec stays as a grounded appendix for if/when its
job outgrows the loop.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
…cout-runtime service)

Sam's intent, third round: the per-user Scout itself runs as a hosted pi
agent — not an engine swap inside the backend, not a separate cloud tier.
Shape: a dedicated scout-runtime Deployment multiplexing one persistent
pi session per user (state on PVC) — the structural successor to
clawdbot-gateway, rebuilt on pi+MCP with per-user isolation and session
memory. Backend stays the scheduler with a flagged fallback to the native
loop. Heavyweight entitlement seats = same runner, per-seat containers.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
@lilyshen0722

Copy link
Copy Markdown
Contributor Author

Final form after three rounds with Sam (the PR description below is historical): Part A = Scout IS the cloud pi agent. A dedicated scout-runtime Deployment multiplexes one persistent pi session per user (state on PVC) — the structural successor to clawdbot-gateway, rebuilt on pi + the MCP tool contract, with per-user isolation (v1 dirs → v2 worker pool) and session memory (Scout remembers conversations — the real product upgrade). Backend stays the scheduler; native loop is the flagged fallback. Heavyweight entitlement seats = the same runner in per-seat containers. Part B (OpenClaw retirement) gates on native adequacy + acceptance, independent of pi. Ready to ratify.

lilyshen0722 and others added 6 commits August 13, 2026 14:28
…event TTL, manual fallback fully defined

pod-architect verified against prod: the default 30-min pending GC deletes
queued turns (the ratified 'deliver late' semantics were false past 30min)
— hosted events get a dedicated TTL retiring to visible 'failed'; the
10-min requeue makes claims-in-M1 mandatory; the 7-day stale-install sweep
would de-route a recovered runtime — hosted installs exempted. Manual
fallback gains trigger/mechanism/owner/granularity/revert (sprint-review:
it was decided in name only). Per-install override must live outside
projected config (refresh-native-agent-configs would revert it).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
…s (fleet round 3)

sprint-review's last review point, verified at source: the 30-minute
AGENT_EVENT_STALE_PENDING_MINUTES threshold is a lower bound, because the
caller is a */10 cron — a pending row survives to its first sweep after
ageing past the threshold. And :691 is deleteMany, not a status flip, so
after an outage the aggregate count reaches stdout but not which users and
pods lost turns.

Both facts sharpen why hosted events retire to `failed` instead of
inheriting the default, so the clause lands on the turn-flow item that
already carries the exemption rather than opening a new one.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
Sam ratified 2026-08-13. The supersession line kept its "when accepted"
hedge, which reads as satisfied on an Accepted ADR; it now says the
supersession is in force and names the CLAUDE.md moltbot-row edit as
follow-through that has not been made, so the doc does not claim work
nobody has done.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
@lilyshen0722
lilyshen0722 merged commit ff94deb into main Aug 13, 2026
10 checks passed
@lilyshen0722
lilyshen0722 deleted the docs/adr-021-pi-engine-openclaw-retirement branch August 13, 2026 22:02
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