Skip to content

Add shared tool execution and durable bounded work - #2

Merged
Tom-R-Main merged 2 commits into
mainfrom
codex/durable-work-runtime
Oct 13, 2026
Merged

Tom-R-Main merged 2 commits into
mainfrom
codex/durable-work-runtime

Conversation

@Tom-R-Main

@Tom-R-Main Tom-R-Main commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Tool calls previously followed different validation, execution, and result-recording paths across hosts. This change routes direct calls, MCP, chat, agents, and workflows through a shared policy, scheduler, and receipt boundary, and adds an opt-in local controller for bounded work with durable recovery.

The controller uses persisted execution and completion grants, authoritative lease checks, separate execution/work journals, immutable output artifacts, and verification bound to current inputs and mutation epochs. Queued work and verification recheck ownership before dispatch. Completion fingerprints every proof subject after awaited readbacks and immediately after the final authority lookup. Uncertain effects stop queued work; explicit independent readback can reconcile an interrupted correction without repeating its effect or rewriting the original unknown receipt.

Included

  • Side-effect-free compiled library exports and CLI, preserving workshop commands; caller-owned store paths and explicit PostgreSQL flush semantics.
  • JSON Schema validation, canonical results, receipts, FIFO scheduling, cancellation, and shared caller/host projections. Schema-valid ordinary data is projected into MCP structuredContent without changing its canonical result or receipt.
  • Protected journals, local backend, reviewed grant CLI, bounded step catalogs, fresh verification, and crash-safe output accounting.
  • A 32 KiB budget for admitted work operation responses, including handler errors. Oversized replies expose bounded summaries and immutable canonical output artifacts, with deduplication across restarts and bounded current-attempt/preview artifact reads. Quota exhaustion preserves known operation certainty.
  • Portable Hermes plugin, generic MCP provider, authenticated Siftable read/evidence boundaries, and pinned OpenClaw/Pi integration checks.
  • Session v2 compatibility, context provenance and refresh notices, optional history budgets, documentation, and CI lanes.

Hosted Siftable durable recovery remains disabled before any claim: SDK 1.5.1 does not establish the supported public parser or receipt/key guarantees required for automatic recovery. The versioned contract matrix records these gaps. Native host actions outside the OpenFunction executor remain outside its journals.

Validation

The updated commit was checked locally on Node 26.5.1:

  • npm test: 269 existing tests pass.
  • npm run test:focused: 220 tests pass, including 65 controller tests, eight work-output tests, five real MCP protocol tests, 19 executor tests, and 10 context tests.
  • Thirteen remediation regressions cover queued verifier ownership, subject changes during readback and the final grant lookup, MCP output projection, large manifests, artifact readback/deduplication, quota exhaustion, and bounded failure responses.
  • Typecheck and TypeScript 7/6 parity pass: 202 artifacts, identical runtime JavaScript, four declaration-order-only differences.
  • Pinned native OpenClaw/Pi type, manifest, loader and runtime gates pass; compiled grant CLI tests pass 3/3. OpenClaw contracts were regenerated from the actual plugin.
  • The four original reproductions were rerun against the compiled library: successor verification runs zero commands; stale proof routes to review; schema-valid data succeeds over MCP; large verification/status output stays below 32 KiB.
  • Independent remediation review found no remaining actionable findings within the scoped changes.

All six CI jobs pass on this updated commit on Node 22/24: full tests, compiler parity, fresh tarball consumers, compiled grant CLI, native OpenClaw/Pi gates, and real pinned Hermes grant/recovery proofs. Hermes pin: 7cc3fb8cb55898747dd1dfa56fda3e16ebba028e. CI results.

Host proofs use isolated filesystem jobs and deterministic model endpoints. No paid model calls or live hosted queue mutations were needed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T18:04:52.641950Z 4c52e5c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c52e5c314

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/framework/context.ts
Comment on lines +281 to +284
const key = cacheIdentity(provider);
const previous = cache.get(key);
const refresh = previous === undefined || options.freshness === "turn" || invalidatedConnections.has(provider);
if (!refresh && previous !== undefined) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Key snapshot caches by the returned scope

When a ConnectedProvider omits the optional contextScope but its buildSnapshot() follows a changed authenticated principal or workspace, this lookup always uses the same {} scope key and returns the previous session-cached snapshot without calling the provider. Reusing that connection can therefore expose one principal's context to another; require a stable declared scope or derive and validate the cache key from the returned snapshot before reusing it.

Useful? React with 👍 / 👎.

const state=this.requireState();
const stepNames=new Set(Object.values(this.options.steps).map(step=>step.toolName));
const last=this.executions?.recover().filter(execution=>execution.settled && stepNames.has((execution.settled.receipt as {toolName:string}).toolName)).at(-1);
const lastStepExecution=last ? Buffer.byteLength(JSON.stringify(last.settled)) <= 16*1024 ? {executionId:last.executionId,...last.settled} : {executionId:last.executionId,receipt:last.settled!.receipt,artifactRef:state.outputArtifacts[last.executionId],resultAvailable:true} : undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve results before projecting them as artifacts

When a step settlement exceeds the 16 KiB status cutoff but the execution remains below the separate 30 KiB artifact cutoff, no artifact is created, yet this branch removes the result and reports an undefined artifactRef with resultAvailable: true. After the immediate step response is gone, of_work_status cannot provide or reference that result; align the cutoffs or retain the inline settlement whenever no artifact exists.

Useful? React with 👍 / 👎.

@Tom-R-Main
Tom-R-Main merged commit fb17e59 into main Oct 13, 2026
6 checks passed
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