* fix(sessions): preserve fork lifecycle ownership and context
Preserve incognito storage, revalidate message-cut authority at commit, and keep late UI fork results scoped to their presentation. Carry prepared child identity and actual context through subagent cleanup and receipts. Verify native source cuts with canonical projection and preserve supervision connection and cleanup ownership. Document the separate canonical-descendant initialization limitation.
* refactor(agents): remove unused subagent prompt task input
* test(codex): validate native fork fixture request shapes
* fix(codex): avoid inherited labels in native session forks
* fix(test): align fork prompt fixtures and session type imports
* refactor(agents): reuse subagent attachment result type
* fix(codex): honor thinking off on Platform routes
Keep reasoning disablement owned by the selected physical model route while
preserving native enabled effort tiers. Supported Platform turns and side
questions now send explicit none; subscription defaults and supervised native
settings remain unchanged.
Closes#132253
* test(codex): load route fixture through public plugin surface
* test(codex): register reasoning regression and synchronize turn startup
* fix(codex): stop native terminals on run cancellation
Codex turn interruption deliberately leaves native background terminals
running. Wait for the matching turn to stop, terminate that thread's
terminals through the app-server API, and join cleanup before releasing
the attempt. Surface cleanup failures without retiring shared peer threads.
Keep existing host process scopes and background gateway jobs unchanged.
Verified with 412 focused tests and an authenticated live Codex run with a
concurrent peer thread on the same app-server.
Co-authored-by: Ming Yoo <mingyouagi@qq.com>
* fix(codex): freeze cancellation before attempt teardown
Close cancellation admission synchronously when cleanup takes ownership,
including when finalization throws before freezing its terminal outcome.
This keeps late aborts from replacing the joined cleanup promise during
resource release or masking the original finalization error.
Move the existing terminal freeze instead of adding another lifecycle flag.
Verified the regression fails before the change; all 413 Codex tests pass.
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: Ming Yoo <mingyouagi@qq.com>
Allow bounded media and completion calls to resolve hidden native catalog entries when a model is explicitly selected. Automatic picker selection remains unchanged.
Fixes#132187.
* fix(chat): stop channel messages borrowing profile identities
Record bounded sender provenance at the input source and require a qualified
profile for portraits, person Activity links, viewer matching, and typing.
Carry the same authenticated fact through live presence for optimistic sends.
Keep historical transcript text and labels without guessing profile identity.
Preserve deliberate hook/redaction behavior, reject sender reassignment, and
keep distinct authors separate in chat grouping and display deduplication.
No SQLite schema change or historical backfill.
Closes#131886
* fix(ui): preserve qualified identity in viewer avatars
Carry the recorded live-user identity through presence projection and avatar
rendering instead of manufacturing profiles from raw presence IDs. Mixed
raw-ID groups remain unqualified; their grouping contract stays separate.
Qualify genuine profile fixtures across Gateway, avatar, and browser tests.
Keep a historical same-ID no-link browser control and preserve strong avatar
layout, retry, and missing-image assertions.
Follow-up for #132038; fixes CI and the retained browser-fixture review finding.
* test: synchronize node approval readiness and qualify presence fixtures
Keep alias display names separate from dispatch identifiers and preserve selected catalog-only providers. Bind native catalog readiness to its producing client, account, configuration, and harness lifetime, with one consistent prepared Gateway projection.
Separate cold registration metadata from execution imports without changing participant persistence or host/profile authority. Include the acceptance-probe request-contract correction and document the isolated deployment boundary.
Required exact-head CI passed. Additional local cold-discovery and Doctor timing failures remain documented on the PR; the maintainer explicitly directed landing with those limitations. No configuration, credentials, deployment, or activation changes.
Closes#131454.
Dispose stateful Codex dynamic tools before route and shared-client release so later sessions can reuse the paired Computer Node.\n\nCo-authored-by: wszkxlllll <10234700473@stu.ecnu.edu.cn>\nCo-authored-by: Ayaan Zaidi <hi@obviy.us>
* fix(agents): restore prepared collector and harness execution
Carry collector output and noninteractive policy through shared tool
preparation. Register Copilot during discovery, initialize selected direct
credentials, retain canonical session IDs, and preserve failed-turn errors.
Keep retained catalog callbacks bound to their owner generation rather
than an expired publication transaction.
Cover the owner boundaries with failing/passing regressions and real
native, Codex, and Copilot Gateway runs, including credential recovery and
same-process worker-policy reloads. Reuse the native auth test fixture
instead of reloading the complete runner in every case.
Fixes#131552Fixes#131580Fixes#131591Fixes#131699Fixes#131700Fixes#131701
Thanks to @tmill313 for the original Codex collector report in #120077.
* test(agents): keep collector proofs on owned boundaries
Move real collector-tool and prepared-registry integration proof to core,
retain independent plugin SDK handoff regressions, and select the host
Copilot integration for plugin-only changes. Run the existing plugin-test
core-import guard in changed-file checks so local validation catches the
same boundary violation as CI.
The replacement regressions fail against their pre-fix owners. All 505
focused tests, the exact import guard, and the changed-file gate pass.
Independent review found no actionable P0-P2 findings. Runtime repair files
are unchanged.
* test(agents): load prepared harness through its public boundary
Evaluate the real Copilot entrypoint through the existing public-surface
loader and module-loader seam instead of importing plugin implementation
into the core typegraph. Remove the synthetic entrypoint and registration
global, while retaining real discovery and lazy-store assertions.
Include the existing core tsgo graph boundary in changed-file checks and
cover its ordinary and live-Docker routing paths.
* test(mcp): seed canonical SQLite session history
Use the installed candidate's public session APIs instead of creating
legacy session files rejected by doctor-only startup. Preserve message IDs,
parent ordering, delivery context, and canonical attachment metadata.
Add a built-SDK fixture regression using real SQLite reads and startup
validation. The full MCP client remains covered by the Docker CI lane.
* test(gateway): preserve queued writes across RPC fixtures
Stop clearing session writer queues before ordinary RPCs. Config fixtures
still synchronize, while canonical writers retain their own cache updates.
Prove queued-write ordering through a real connected Gateway against a raw
WebSocket control, and dispose the custom test database before file removal.
Preserve the underlying cause of the settlement timeout. That CI failure
was not reproduced on the exact synthetic merge locally; the independent
queue-reset defect is not being claimed as its established cause.
* test(agents): keep harness fixture coverage on focused boundaries
* test(imap): await committed watcher initialization
* fix(codex): persist every completed pre-steer assistant item in steering history
The steering transcript prefix reused the final-answer selection barrier,
so a steer consumed after a tool or sleep barrier persisted only the
latest eligible completed assistant item. Earlier completed items stayed
in the gateway run buffer with no durable row, and after a reload the
UI's persisted-prefix subtraction could not cover them — already-seen
pre-steer output re-rendered below the operator's steering message.
Final-answer selection and steering history are different concerns: the
steering path now collects every completed, terminal-eligible, visible
assistant item in chronological order, each with its mirror identity so
repeats across subsequent steers deduplicate. Final-answer candidate
selection, its exclusion tests, terminal-result handling, and the buffer
projection are unchanged. Net +1 production line.
Regressions: four barrier scenarios (none/sleep/dynamic-tool/native-tool)
fail pre-fix losing pre-steer items; snapshot mirror-identity coverage;
UI history recovery of the split after reload.
* fix(codex): keep assistant-message options caller-owned in steering collection
Restores the caller-supplied AssistantMessageOptions contract the boundary
picker had, and tightens the collection return. Also brings the file back
under the max-lines cap that check-lint enforces (the inlined options
object pushed it two counted lines over).
* test(ui): share steering recovery fixtures across identities
* fix: keep model reasoning out of generated session titles
Request strict visible output before transport recovery can discard reasoning
tag provenance. Share host-prepared completion execution across bundled
harnesses while preserving normal completion recovery and title fallback.
Keep selected model/auth routing, HTTP-boundary coverage and persisted-title
browser proof. Remove duplicate completion paths and redundant test setup.
Co-authored-by: luyifan <al3060388206@gmail.com>
* fix(agents): preserve strict empty CLI completions
Forward strict-visible output policy through the CLI owner and allow a clean
empty result only for strict isolated completions. Keep ordinary CLI empty
responses rejected before successful auth settlement, without a silent token.
Consolidate post-dispatch empty validation and duplicate usage test setup.
Co-authored-by: luyifan <al3060388206@gmail.com>
* test(agents): retain label fallback and prompt contracts
Consolidate utility-success coverage into the two-API prompt and auth-owner
table. Keep both rejected and reasoning-only utility fallback cases bound to
the selected runtime owner after the main composition.
Co-authored-by: luyifan <al3060388206@gmail.com>
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix(codex): bridge auth into private bounded turns
* fix(codex): keep custom-command credentials ephemeral
* fix(codex): revalidate shared auth and retire failed refreshes
* fix(codex): preserve claim-derived OAuth workspace ownership
Use the canonical ChatGPT identity resolver when deciding whether a supplied OAuth snapshot still belongs to the persisted account. This prevents a scoped refresh from overwriting a replacement workspace that shares the same email.
Exercise same-workspace and changed-workspace persisted clones with both stored and claim-derived account IDs.
* fix(sessions): stamp creator isolation across creation paths
Carry authenticated creator policy through chat, Talk, recovery, checkpoints,
outbound delivery, cron, and plugin-created upstream forks. Preserve a required
parent's human isolation identity for native and worker children, consults,
and delegated delivery even after role changes.
Only stamp genuinely new rows. Keep required provenance through cron rollovers
and stop required cron execution when pre-run persistence fails.
* refactor(gateway): own creator sandbox resolution in role policy
The new session-creation-provenance module closed a types-only import
cycle: shared-types imports TrustedSessionCreation from it, while its
resolveSandboxedSessionCreation value-imported resolveCreatorSandbox from
operator-role-policy, which reaches shared-types via gateway-client-identity.
Move that one function to operator-role-policy, which already owns
resolveCreatorSandbox, leaving session-creation-provenance a leaf. Three of
the four call sites already imported from operator-role-policy, so they
collapse into an existing import rather than adding an edge.
Extract the connection-pinned legacy voice bindings out of talk-client into
their own module behind a narrow remember/read/forget API, so the TTL prune
runs on every read and write instead of being a caller obligation.
* refactor(cron): move auth-profile selection to its runtime owner
run-prepare.ts sits at the repo's 700-line cap, so the creator-sandbox
threading pushed it over. Rather than shave the fix, move the auth-profile
selection next to the lazy loaders it drives in run-prepare-runtime.ts.
The skip condition and the loader are now one unit, so the runtime still
loads only when an override, configured profile, or store source exists,
instead of that invariant living at the call site.
* refactor(cron): keep auth-profile loaders module-private
resolveCronAuthSelection is now their only consumer and lives in the same
module, so the loader and its configured-profile check no longer need to be
part of the module's public surface.
Codex records native MCP and connector calls under dotted namespaced ids
("codex_apps.slack.slack_send"). The settled-turn projection validated
recorded names against the function-tool registration charset, so any
settled turn that used such a tool failed isolated finalization with
"found an invalid tool name", the plugin-harness error has no embedded
fallback, and the run ended errored+mute with nothing posted to the
channel.
Dotted names are legal where projected names actually go: Codex
thread/inject_items deserializes ResponseItem::FunctionCall { name:
String } (codex-rs app-server/src/request_processors/turn_processor.rs,
protocol/src/models.rs), and the Responses API round-trips them
in-thread. Admit "." in TOOL_NAME_PATTERN and name the offending tool in
the rejection error so remaining charset gaps are diagnosable from logs.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Project channel-originated embedded run identity and bounded progress through Gateway history so Control UI keeps the original timer, safe recent activity, and exact Stop ownership after reload.
Co-authored-by: SunnyShu0925 <shu.zongyu@xydigit.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
* fix: preserve native session ownership during cleanup and attachment
Prepare permitted harness owners for offline session deletion. Reject direct
attachment of parent-controlled Codex children before displacing ownership.
Keep deadline and client authority through binding publication, and release
accepted subscriptions when publication fails without a remaining owner.
Unify conversation create/attach and preserve observational child monitoring.
Verified 950 focused/sibling tests, production and test types, independent
Codex review, and the real built offline CLI capacity reproduction.
* test: avoid shadowing the native binding row
Restricted Codex threads now retain structurally valid request-local MCP transports while policy keeps every server disabled and verifies that no tools become active.
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Release exact thread subscriptions after structured resume failures, preserve pre-enqueue overloads and physical pre-write ownership rejection, and retire only the affected client when cleanup cannot be proven. Route conversation initial attach through the canonical owner and avoid duplicate incognito cleanup.
* refactor(models): simplify picker and thinking projections
* fix(doctor): keep bundled checks in the host health registry
* test(doctor): consolidate repeated lint invocation
* docs: keep Doctor release context in the PR body
* fix(codex): prevent stale resumes from disrupting shared sessions
Carry the existing ownership assertion to each physical RPC write and overload retry. Clear request uncertainty after an explicit overload rejection so a revoked retry preserves its healthy shared client. Remove the redundant request forwarding method.
Verified with transport regressions, 318 focused tests, lint, formatting, and independent review. Live Gateway verification follows before landing.
* docs: keep resume fix release notes in the PR body
* fix(codex): reclaim binding ownership when sessions are deleted
Prepare harness deletion outside the SQLite writer and compare-delete exact companion ownership at the session removal edge, with compensation before commit and native subscription release afterward. Preserve live siblings and upstream native history. Repair proven orphan bindings through the existing Doctor planner under maintenance ownership.
* fix(codex): reuse prepared auth for resumed thread ownership
* docs(plugins): clarify shared migration and auth contracts
* test(codex): use the canonical config type facade
* fix(codex): preserve native threads during manual resume
Record pending attachment intent and validate the immutable native tool catalog
before applying configuration to the selected thread. Require uninterrupted
physical-client ownership through native unsubscribe, resume, and binding commit.
Keep the thread intact on unsupported policy, competing work, or failed proof.
Reuse canonical retained-owner cleanup and preserve unsafe-client retirement.
Cover the real command producer, cold and loaded resumes, competing leases,
lazy-store commit fencing, and the Gateway competing-owner path.
* test: isolate Codex auth and session completion fixtures
The detached Skill Workshop experience review rebuilt its system prompt and tool catalog from a different context than the foreground turn, so every review missed the prompt cache. Native harnesses (embedded, Codex, Copilot) now hand the review the same foreground prompt context via buildEmbeddedForegroundPromptContext; the review reuses the foreground prefix and gates execution to skill_workshop while keeping the catalog identical. Reviews without a foreground prompt (CLI hook contexts) are skipped.
* fix(gateway): permission modes work on rootless sessions via workspace default root
Session permission modes hard-required a recorded sessionRoot, which only the
sessions.create RPC ever records. Channel sessions, pre-#124909 rows, and
exec-node sessions are rootless, so runs failed closed with 'session permission
mode requires a recorded session root' (rows poisoned before the #128149 guards
were permanently bricked) and operators could not set a mode on channel
sessions at all.
The mode semantics are root-free; every containment consumer already falls
back to the workspace, and the remote worker launcher already derives its
containment root from placement.remoteWorkspaceDir. Make that the canonical
rule: a recorded sessionRoot pins worktree/explicit-cwd boundaries, and a
rootless session's boundary is the agent's canonical workspace resolved where
the run is prepared.
- embedded runner + compaction: default policy root to realpath(workspace)
instead of throwing/dropping the mode; bricked rows self-heal
- gateway: delete the patch/create/reset rejection guards and
session-permission-policy.ts entirely
- codex plugin: helpers take a required defaultRoot (agent workspace fact,
never a requested thread cwd); delete the four root throws; sandbox context
for conversation bindings now derives from the agent workspace
- ui: drop the rootless-rejection surface from the permission picker
- docs: permission-modes boundary contract updated
* fix(agents): split workspace path identity out of the kysely state store
Heals main: #116650 made memory-host-sdk/dreaming.ts import
resolveWorkspaceStateIdentity from workspace-state-store, statically pulling
kysely into the memory-core doctor-contract closure and failing the
doctor-contract-closure-guard lane on origin/main. The identity helpers are
pure path/crypto code; move them to workspace-state-identity.ts and repoint
all importers (dreaming, event-store, onboarding recommendations, workspace
migrations, legacy state).
* fix(ui): drop the unused permission picker sessionRoot prop and dead i18n keys
check-prod-types caught the New Session dialog still passing the removed
sessionRoot picker prop; the prop and the permissionControls.rootLabel /
sessionRoot strings have had no consumers since #124301.
* fix(codex): resolve rootless permission boundaries from agent config, not bind cwd
ClawSweeper P1: /codex bind --cwd stores the requested path as the binding
workspaceDir, which the previous commit then trusted as defaultRoot — letting
a bound thread's requested cwd become (and widen) the rootless permission
boundary. resolveConversationAppServerRuntime now owns the fact: it resolves
the selected agent's canonical workspace from config (falling back to the
plugin's configured default workspace), and the caller-supplied
agentWorkspaceDir parameter chain is deleted so no call site can pass a
tainted value. Recovery of recorded roots is unchanged (pinned roots stay
pinned); the moved-history test now proves the bind-cwd clamp lands on the
agent workspace.
* fix(codex): keep /codex model scoped to the native binding
/codex model wrote the outer OpenClaw session model override (and marked
a pending live model switch) any time a session context was present,
even for a thread bound through /codex bind. In a dual-runtime setup
that let a Codex-scoped model change silently redirect the next turn
to a different configured runtime. The binding store is now the sole
owner of this selection; only /model may change the outer session
override.
* fix(codex): make /codex model status binding-owned
The no-argument /codex model status read still preferred the outer
SessionEntry override over the native binding, so it could report a
stale model that diverged from what /codex model just wrote to the
binding. Read the binding first and fall back to the outer session
model only when no binding exists yet.
* fix(codex): preserve authoritative model selection ownership
Co-authored-by: chelsealong <chelsealong@126.com>
* fix(codex): retain session identity narrowing
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>