Skip to content

Use Arc-based ToolCtx in tool runtimes#12583

Merged
bolinfest merged 1 commit intomainfrom
pr12583
Feb 23, 2026
Merged

Use Arc-based ToolCtx in tool runtimes#12583
bolinfest merged 1 commit intomainfrom
pr12583

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Feb 23, 2026

Why

Tool handlers and runtimes needed to pass the same turn/session context for shell and non-shell workflows without duplicative ownership churn. Using shared pointers avoids temporary lifetimes and keeps existing behavior unchanged while simplifying call sites.

What changed

  • Converted ToolCtx to store shared context handles (Arc-based), including updates across shell, apply-patch, and unified-exec paths.
  • Updated orchestrator/runtime call sites to consume the shared context consistently and remove brittle move/borrow patterns.
  • Kept behavior unchanged while preparing the type surface for the new shell escalation integration in the next stack commit.

Verification

  • Validated this commit stack point with just clippy and confirmed workspace compiles cleanly in this stack state.

Stack created with Sapling. Best reviewed with ReviewStack.

bolinfest added a commit that referenced this pull request Feb 23, 2026
…lation (#12556)

## Why
Shell execution refactoring in `exec-server` had become split between
duplicated code paths, which blocked a clean introduction of the new
reusable shell escalation flow. This commit creates a dedicated
foundation crate so later shell tooling changes can share one
implementation.

## What changed
- Added the `codex-shell-escalation` crate and moved the core escalation
pieces (`mcp` protocol/socket/session flow, policy glue) that were
previously in `exec-server` into it.
- Normalized `exec-server` Unix structure under a dedicated `unix`
module layout and kept non-Unix builds narrow.
- Wired crate/build metadata so `shell-escalation` is a first-class
workspace dependency for follow-on integration work.

## Verification
- Built and linted the stack at this commit point with `just clippy`.

[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/12556).
* #12584
* #12583
* __->__ #12556
Base automatically changed from pr12556 to main February 23, 2026 17:28
@bolinfest bolinfest enabled auto-merge (squash) February 23, 2026 18:05
@bolinfest bolinfest disabled auto-merge February 23, 2026 18:13
@bolinfest bolinfest enabled auto-merge (squash) February 23, 2026 18:13
@bolinfest bolinfest merged commit 7f75e74 into main Feb 23, 2026
62 of 66 checks passed
@bolinfest bolinfest deleted the pr12583 branch February 23, 2026 18:29
@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants