Skip to content

experimentalRawEvents cannot be enabled on thread/resume / thread/fork, so raw-event mirroring permanently breaks after any resume #34353

Closed

Description

@bmaurer

Summary

thread/start accepts experimentalRawEvents: true, which makes the app-server stream every raw ResponseItem as rawResponseItem/completed (and emit rawResponse/completed). However, there is no way to enable raw events on thread/resume or thread/fork: ThreadResumeParams and ThreadForkParams have no such field, and the app-server hardcodes raw_events_enabled: false when it attaches the listener for a resumed or forked thread. Since the flag lives only in the in-process ThreadState (it is not persisted with the thread), every resume of a non-running thread — including a same-process resume of a thread that was originally started with the flag — silently and permanently disables raw events for all subsequent turns. There is no workaround: we probed the param on thread/resume, config overrides (-c), thread/fork, and the experimental-feature APIs, and found no way to re-enable it.

Observed on codex-cli 0.144.4 via live JSON-RPC probes; the code is unchanged at current main (86102db, 2026-07-20).

Use case

We build durable session mirroring on top of the app-server: we start threads with experimentalRawEvents: true, journal each rawResponseItem/completed payload, and if the host running the app-server is lost we resume the thread on another host with thread/resume { threadId, history: [ ...journaled items ] }. This is exactly the "FOR CODEX CLOUD" flow that ThreadResumeParams.history documents. The gap means the mirror only survives one hop: after the first thread/resume, no further raw items are emitted, so the journal can never be brought up to date again and a second host failure loses the session.

Root cause (file/line, rust-v0.144.4 and main)

The flag is per-thread in-process state:

  • codex-rs/app-server/src/thread_state.rs:89 — ThreadState.experimental_raw_events: bool (default false), set only via set_experimental_raw_events from ThreadStateManager::try_ensure_connection_subscribed(..., experimental_raw_events) (thread_state.rs:497-524 at main).
  • codex-rs/app-server/src/request_processors/thread_lifecycle.rs:314-325 — the listener event loop drops EventMsg::RawResponseItem / RawResponseCompleted unless the thread's flag is set. Core always emits these events (codex-rs/core/src/session/mod.rs:3134-3142); the app-server filter is the only gate, and the flag is never persisted to the rollout.

Who sets the flag:

  • thread/start passes params.experimental_raw_events through to the listener attach — thread_processor.rs:1301-1310 at main (:1285-1290 at rust-v0.144.4). ✅
  • thread/resume (both the history variant and disk resume converge on one attach site) hardcodes false — thread_processor.rs:3245-3255 at main (:2858 at rust-v0.144.4). ❌
  • thread/fork hardcodes false — thread_processor.rs:4179-4189 at main (:3609 at rust-v0.144.4). ❌
  • Spawned child (subagent) threads inherit the flag from their parent thread since [codex] Inherit raw events for spawned child listeners #25603 ("Inherit raw events for spawned child listeners") — thread_processor.rs:2981-3012 at main. ✅

So the propagation gap was already recognized and fixed for spawned children in #25603; resume and fork were just not covered. A resume with history forks to a new thread id, and a disk resume of an unloaded thread builds a fresh ThreadState, so in both cases the default false wins and raw events are gone for good.

Reproduction (0.144.4)

  1. thread/start { "experimentalRawEvents": true } → run a turn → rawResponseItem/completed notifications arrive for every response item. ✅
  2. thread/resume { "threadId": "<id>", "history": [ ...items ] } (or plain thread/resume after the thread is unloaded) → run a turn → no rawResponseItem/completed notifications, and no field on ThreadResumeParams accepts the opt-in. ❌

Minimal transcript for step 2's turn (0.144.4): the turn streams item/started / item/completed etc. normally, but zero rawResponseItem/completed, confirming the events are filtered app-server-side rather than not produced (core emits them unconditionally; see above).

Proposed fix

Mirror the thread/start opt-in on the other two thread-construction methods, keeping the experimental naming and semantics:

  • Add #[experimental("thread/resume.experimentalRawEvents")] experimental_raw_events: bool to ThreadResumeParams, and the equivalent thread/fork.experimentalRawEvents to ThreadForkParams.
  • Pass the value through the existing ensure_conversation_listener(..., raw_events_enabled) at the resume attach site (thread_processor.rs:3245) and the fork attach site (thread_processor.rs:4179), replacing the hardcoded false.
  • For the running-thread rejoin path in resume_running_thread, set the flag on the existing ThreadState when requested (same monotonic enable-only semantics as try_ensure_connection_subscribed).

Because both new fields are #[experimental], the vendored (non-experimental) schema fixtures are unchanged, and the wire behavior for clients that don't send the field is identical.

We have this implemented and verified on a branch against current main (86102db): two new integration tests, thread_resume_with_history_supports_experimental_raw_events (tests/suite/v2/thread_resume.rs) and thread_fork_supports_experimental_raw_events (tests/suite/v2/thread_fork.rs), exercise resume-with-history and fork followed by a live turn against the mock Responses server and assert a rawResponseItem/completed notification arrives. Both fail with the current attach sites (the notification never arrives) and pass with the param plumbed through; the full thread_resume/thread_fork suites (60 tests) and cargo test -p codex-app-server-protocol (including the schema-fixture checks) pass, and write_schema_fixtures produces no diff. Happy to send the PR if the team wants to invite it, per the contribution policy — or feel free to just take the outline above; the change is small.

An alternative we considered: persisting the opt-in with the thread (rollout metadata) so resume restores it automatically. That is more invasive and changes semantics for existing clients, so the per-call param felt safer and consistent with thread/start.

Activity

  1. added
    bug
    app-server
    session
    on Jul 20, 2026
  2. bmaurer commented on Jul 20, 2026

    @bmaurer
    Author

    The fix described above is now pushed to a branch on my fork for easy review: https://github.com/bmaurer/codex/tree/fix/raw-events-resume-fork (single commit on top of 86102db; compare view: main...bmaurer:codex:fix/raw-events-resume-fork).

    Happy to open it as a PR if the team invites one, per the contribution policy.

  3. bmaurer commented on Jul 20, 2026

    @bmaurer
    Author

    Follow-up after more source digging: there IS a workaround pattern that avoids the resume gap entirely, which may be how Codex Cloud consumes this — thread/inject_items (#17703). Starting a FRESH thread with experimentalRawEvents: true, then injecting the captured raw history via thread/inject_items, then running turns keeps raw events enabled for the thread's whole life (and record_conversation_items even echoes the injected items as rawResponseItem/completed). Verified end-to-end on 0.144.4 with a live turn.

    So the resume/fork param asymmetry reported above is not blocking for us anymore — though it still seems worth fixing for API coherence (resume-by-thread_id/path users get silent raw-event loss with no workaround that preserves the thread id). Feel free to deprioritize accordingly.

  4. bmaurer commented on Jul 20, 2026

    @bmaurer
    Author

    Closing this out: thread/inject_items (#17703) fully covers our use case. Starting a fresh thread with experimentalRawEvents: true and injecting the captured raw history keeps raw events enabled for the thread's entire life — and the injected items are even echoed back as rawResponseItem/completed and persisted to the rollout, so the reconstructed thread is re-mirrored and locally resumable on the new host. Verified end-to-end on 0.144.4 with live turns.

    That appears to be the intended pattern for this scenario, so the resume/fork param asymmetry is a non-issue in practice. Leaving the branch up (https://github.com/bmaurer/codex/tree/fix/raw-events-resume-fork) in case the team still wants the params for API coherence, but closing as answered/not-needed.

  5. cassthebandit commented on Oct 29, 2026

    @cassthebandit

    We still need the same-thread resume case described here. The new-thread + thread/inject_items workaround is useful for mirroring, but it does not preserve a resumed parent's thread identity or its existing native child ownership.

    On October 27, I reproduced the opt-in gap with an unmodified codex-cli 0.164.0 Linux ARM64 app-server and a local mocked Responses/SSE provider. The process ran in a network-disabled container with a synthetic CODEX_HOME, no credentials, and no real model calls:

    • New thread with experimentalRawEvents:true: normal turn completion and rawResponse/completed with the exact provider responseId, thread ID and turn ID.
    • Loaded rejoin of that already-enabled thread: same positive result.
    • Loaded rejoin of an initially disabled thread, passing experimentalRawEvents:true: normal turn completion but no raw completion notification.
    • Restart app-server and cold-resume the original opted-in thread ID, again passing experimentalRawEvents:true: normal turn completion but no raw completion notification.
    • Disabled fresh-thread control: normal completion without raw events.
    • Provider failure after an output item, and interruption after an output item but before provider completion: raw items arrive, but no rawResponse/completed. These controls matter because an item event is not a successful sampling-completion acknowledgment.

    All seven scenarios matched those expectations. This is a real app-server protocol test against a mocked HTTP provider, not a production-model test or a deterministic native compaction/preemption test.

    A fresh source check on October 29 found the same gap at pinned main 9def09af. I did not build or run this newer source:

    Our concrete use case is openclaw/openclaw#186128: distinguish a child result that native actually consumed in a successful sampling response from one merely included in a provider request before native preemption. Transport completion and generic turn completion are not sufficient substitutes. The existing rawResponse/completed notification supplies the matching response identifier, but the cold-resume listener filter makes it unavailable for this identity-preserving path.

    Could this issue be reopened for the unresolved same-thread-ID resume case? The fresh-thread + thread/inject_items workaround addressed the original mirroring use case, but cannot preserve the parent thread identity and existing child ownership required by our integration. The reproduction and current-source evidence above show this gap still applies. We are keeping that evidence here rather than opening a duplicate, per the contribution guidance.

    The requested behavior is the resume opt-in described in the original report, covering both cold resume and the serialized loaded-thread rejoin path. We would preserve the existing default-false, enable-only semantics and reuse the existing completion notification. We are not proposing a new acknowledgment ledger or treating the issue's closed state as evidence the gap was fixed. Following the contribution policy, this is reproduction evidence and current-source design context, not an unsolicited code PR.


    Standalone reproducer: same-thread resume raw events

    Adding a runnable, dependency-free reproducer for this existing report. I reran the actual Linux ARM64 codex-cli 0.164.0 native executable with Node.js v24.22.1, a fresh synthetic CODEX_HOME, and a localhost HTTP/SSE Responses fixture inside a network-disabled container. No credentials or actual model requests were used.

    Binary SHA-256: 8813c8d8a4cea2eeba271b72ab22f49628b184b24ab18dbef06b4ce41e9a8d39.

    All seven baseline assertions passed:

    1. New opted-in thread: completion notification with exact provider response/thread/turn IDs.
    2. Loaded rejoin of already-enabled thread: same notification.
    3. Synthetic assistant output item then provider failure: no completion notification.
    4. Synthetic assistant output item then interruption before provider completion: no completion notification.
    5. New disabled thread: no raw items or completion notification.
    6. Loaded rejoin of disabled thread with experimentalRawEvents:true: still no raw events.
    7. Restart app-server, resume the original enabled thread ID with experimentalRawEvents:true: completed turn, but no raw events.

    “Passed” here means the current baseline, including the missing resume capability, was reproduced, not repaired. The desired change would make scenarios 6 and 7 emit raw events and require updating their assertions. The fixture waits for the exact synthetic assistant output item before interrupting; user/developer input items cannot satisfy that condition.

    Please consider reopening this report. New-thread + injected-history changes thread identity and therefore is not an equivalent workaround for integrations retaining existing parent/child ownership. The requested API capability is opt-in raw events on same-thread thread/resume, including cold resume and a loaded but previously-disabled thread.

    Run

    On Linux ARM64, with the above already-available binary and Node.js >=22, save the code below as probe.mjs and run in a disposable network-disabled environment with loopback available:

    node probe.mjs /absolute/path/to/codex /absolute/path/to/new-output-directory

    The output directory must not exist. The fixture pins checksum/version, creates only synthetic state there, writes result/event/request logs, and exits nonzero on assertion failure. It does not install dependencies. The network boundary is provided by the caller/container, not by JavaScript.

    Evidence limits: runtime proof is pinned to 0.164.0, not a claim to have built or executed latest main. The pinned October 29 source inspection linked above remains separate evidence; this rerun does not build or execute that source. Failure/interruption controls do not prove the harder buffered-provider-completion/native-preemption race. This fixture does not test compaction, websocket routing, OpenClaw end-to-end delivery, or a patched binary.

    Complete standalone probe.mjs
    // Dependency-free reproduction for openai/codex#34353. Node.js >= 22.
    import assert from 'node:assert/strict';
    import fs from 'node:fs';
    import path from 'node:path';
    import http from 'node:http';
    import { createHash } from 'node:crypto';
    import { spawn, spawnSync } from 'node:child_process';
    import readline from 'node:readline';
    
    const [binaryArg, outputArg] = process.argv.slice(2);
    if (!binaryArg || !outputArg) throw new Error('Usage: node probe.mjs /absolute/path/to/codex /new/output/directory');
    const binary = path.resolve(binaryArg);
    const root = path.resolve(outputArg);
    const expectedSha256 = '8813c8d8a4cea2eeba271b72ab22f49628b184b24ab18dbef06b4ce41e9a8d39';
    const binarySha256 = createHash('sha256').update(fs.readFileSync(binary)).digest('hex');
    assert.equal(binarySha256, expectedSha256, 'Use the pinned Linux ARM64 codex 0.164.0 native executable');
    assert.ok(!fs.existsSync(root), 'Output directory must not already exist; never use your real CODEX_HOME');
    fs.mkdirSync(root, { recursive: true });
    const home = path.join(root, 'home');
    const cwd = path.join(root, 'cwd');
    fs.mkdirSync(home); fs.mkdirSync(cwd);
    const childEnv = { PATH: process.env.PATH || '/usr/bin:/bin', HOME: home, CODEX_HOME: home, TMPDIR: root };
    const version = spawnSync(binary, ['--version'], { env: childEnv, encoding: 'utf8' });
    assert.equal(version.status, 0);
    assert.equal(version.stdout.trim(), 'codex-cli 0.164.0');
    let requestCount = 0, nextMode = 'success';
    const requests = [], events = [], results = [];
    let stderr = '', child, sequence = 0;
    const pending = new Map();
    const pause = ms => new Promise(resolve => setTimeout(resolve, ms));
    async function until(predicate, label, timeout = 20000) {
      const deadline = Date.now() + timeout;
      while (!predicate()) {
        if (Date.now() >= deadline) throw new Error('Timeout: ' + label);
        await pause(10);
      }
    }
    const server = http.createServer(async (req, res) => {
      let body = ''; for await (const chunk of req) body += chunk;
      if (!req.url.includes('/responses')) { res.writeHead(404); res.end(); return; }
      const id = `resp_probe_${++requestCount}`;
      requests.push({ id, url: req.url, body: JSON.parse(body) });
      const mode = nextMode; nextMode = 'success';
      res.writeHead(200, { 'content-type': 'text/event-stream' });
      const item = { id: `msg_${requestCount}`, type: 'message', role: 'assistant', status: 'completed',
        content: [{ type: 'output_text', text: 'PROBE_OK', annotations: [] }] };
      const event = (type, data) => res.write(`event: ${type}\ndata: ${JSON.stringify({ type, ...data })}\n\n`);
      event('response.created', { response: { id, status: 'in_progress', output: [] } });
      event('response.output_item.added', { output_index: 0, item: { ...item, status: 'in_progress', content: [] } });
      event('response.output_text.delta', { item_id: item.id, output_index: 0, content_index: 0, delta: 'PROBE_OK' });
      event('response.output_item.done', { output_index: 0, item });
      if (mode === 'hold') return; // Client interrupts only after a raw item is actually observed.
      if (mode === 'fail') {
        event('response.failed', { response: { id, status: 'failed', error: { code: 'server_error', message: 'Intentional isolated proof failure' } } });
        res.end(); return;
      }
      event('response.completed', { response: { id, status: 'completed', output: [item],
        usage: { input_tokens: 10, output_tokens: 3, total_tokens: 13, input_tokens_details: { cached_tokens: 0 } } } });
      res.end();
    });
    await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));
    const port = server.address().port;
    fs.writeFileSync(path.join(home, 'config.toml'), `model = "gpt-5"\nmodel_provider = "local_probe"\napproval_policy = "never"\nsandbox_mode = "danger-full-access"\n[model_providers.local_probe]\nname = "Synthetic local provider"\nbase_url = "http://127.0.0.1:${port}/v1"\nwire_api = "responses"\nrequest_max_retries = 0\nstream_max_retries = 0\n`);
    function send(method, params) {
      return new Promise((resolve, reject) => {
        const id = ++sequence;
        const timer = setTimeout(() => { pending.delete(id); reject(new Error('RPC timeout: ' + method)); }, 15000);
        pending.set(id, { resolve: result => { clearTimeout(timer); resolve(result); }, reject: error => { clearTimeout(timer); reject(error); } });
        child.stdin.write(JSON.stringify({ id, method, params }) + '\n');
      });
    }
    async function start() {
      child = spawn(binary, ['app-server'], { cwd, env: childEnv });
      child.stderr.on('data', chunk => { stderr += chunk; });
      child.on('error', error => { for (const waiter of pending.values()) waiter.reject(error); pending.clear(); });
      readline.createInterface({ input: child.stdout }).on('line', line => {
        let message; try { message = JSON.parse(line); } catch { return; }
        if (message.id !== undefined && pending.has(message.id)) {
          const waiter = pending.get(message.id); pending.delete(message.id);
          message.error ? waiter.reject(new Error(JSON.stringify(message.error))) : waiter.resolve(message.result);
        } else events.push(message);
      });
      await send('initialize', { clientInfo: { name: 'resume-raw-events-repro', version: '1.0' }, capabilities: { experimentalApi: true } });
      child.stdin.write('{"method":"initialized","params":{}}\n');
    }
    async function stop() {
      if (!child || child.exitCode !== null || child.signalCode !== null) return;
      const active = child;
      await new Promise(resolve => {
        const timer = setTimeout(() => active.kill('SIGTERM'), 1500);
        active.once('exit', () => { clearTimeout(timer); resolve(); });
        active.stdin.end();
      });
    }
    async function turn(threadId, label, mode = 'success') {
      nextMode = mode;
      const firstEvent = events.length, firstRequest = requests.length;
      const response = await send('turn/start', { threadId, input: [{ type: 'text', text: 'Return PROBE_OK only.' }] });
      const turnId = response.turn.id;
      const inTurn = event => event.params?.threadId === threadId && event.params?.turnId === turnId;
      const providerItem = event => event.method === 'rawResponseItem/completed' && inTurn(event) && event.params.item?.role === 'assistant' && event.params.item?.id === `msg_${firstRequest + 1}`;
      if (mode === 'hold') {
        await until(() => events.slice(firstEvent).some(providerItem), 'raw item before interrupt');
        await send('turn/interrupt', { threadId, turnId });
      }
      await until(() => events.slice(firstEvent).some(event => event.method === 'turn/completed' && event.params.threadId === threadId && event.params.turn.id === turnId), label);
      const observed = events.slice(firstEvent);
      const completed = observed.find(event => event.method === 'turn/completed' && event.params.threadId === threadId && event.params.turn.id === turnId);
      assert.equal(requests.length - firstRequest, 1, label + ': one synthetic provider response');
      return { label, threadId, turnId, status: completed.params.turn.status,
        rawCompletions: observed.filter(event => event.method === 'rawResponse/completed').map(event => event.params),
        rawItems: observed.filter(providerItem).length,
        providerResponseId: requests[firstRequest].id };
    }
    let passed = false;
    try {
      await start();
      const enabled = (await send('thread/start', { cwd, experimentalRawEvents: true })).thread.id;
      results.push(await turn(enabled, 'new opted-in'));
      await send('thread/resume', { threadId: enabled, experimentalRawEvents: true });
      results.push(await turn(enabled, 'loaded rejoin already enabled'));
      results.push(await turn(enabled, 'provider failure no completion', 'fail'));
      results.push(await turn(enabled, 'raw item then interrupt before provider completion', 'hold'));
      const disabled = (await send('thread/start', { cwd, experimentalRawEvents: false })).thread.id;
      results.push(await turn(disabled, 'new disabled control')); // Persists a rollout before rejoin.
      await send('thread/resume', { threadId: disabled, experimentalRawEvents: true });
      results.push(await turn(disabled, 'loaded rejoin initially disabled attempted opt-in'));
      await stop(); await start();
      await send('thread/resume', { threadId: enabled, experimentalRawEvents: true });
      results.push(await turn(enabled, 'cold resume attempted opt-in'));
      await stop();
      const expectedStatuses = ['completed', 'completed', 'failed', 'interrupted', 'completed', 'completed', 'completed'];
      assert.equal(results.length, 7);
      for (const [index, result] of results.entries()) {
        assert.equal(result.status, expectedStatuses[index], result.label);
        assert.equal(result.rawCompletions.length, index < 2 ? 1 : 0, result.label + ': raw completion count');
        assert.ok(index < 4 ? result.rawItems > 0 : result.rawItems === 0, result.label + ': raw item count');
        for (const completion of result.rawCompletions) {
          assert.equal(completion.threadId, result.threadId);
          assert.equal(completion.turnId, result.turnId);
          assert.equal(completion.responseId, result.providerResponseId);
        }
      }
      passed = true;
      console.log('PASS: 7/7 scenario assertions; cold resume still lacks raw events.');
      console.log(JSON.stringify(results, null, 2));
    } catch (error) {
      console.error(error); process.exitCode = 1;
    } finally {
      await stop();
      server.closeAllConnections(); await new Promise(resolve => server.close(resolve));
      fs.writeFileSync(path.join(root, 'results.json'), JSON.stringify({ version: version.stdout.trim(), binarySha256, nodeVersion: process.version, passed, results }, null, 2) + '\n');
      fs.writeFileSync(path.join(root, 'events.json'), JSON.stringify(events, null, 2) + '\n');
      fs.writeFileSync(path.join(root, 'requests.json'), JSON.stringify(requests, null, 2) + '\n');
      fs.writeFileSync(path.join(root, 'stderr.log'), stderr);
    }
  6. budzation commented on Nov 16, 2026

    @budzation

    Independent same-thread resume verification — 16 November 2026

    I independently reran the standalone probe from this issue against the unmodified Linux ARM64 Codex 0.164.0 executable, SHA-256 8813c8d8a4cea2eeba271b72ab22f49628b184b24ab18dbef06b4ce41e9a8d39.

    The probe ran in a new user/network namespace with only loopback and no external route, a fresh synthetic CODEX_HOME and a local synthetic HTTP/SSE Responses provider. No credentials, real inference, user conversations or production Gateway state were used.

    All seven baseline/control assertions matched:

    1. Fresh opted-in thread: raw completion with matching response, thread and turn IDs.
    2. Loaded rejoin of an already-enabled thread: same positive result.
    3. Provider failure after an output item: raw item, no successful raw completion.
    4. Interruption after an output item: raw item, no successful raw completion.
    5. Fresh disabled thread: completed turn, no raw items/completion.
    6. Loaded rejoin of an initially-disabled thread with experimentalRawEvents:true: completed turn, still no raw items/completion.
    7. App-server restart followed by same-ID cold resume with experimentalRawEvents:true: completed turn, still no raw items/completion.

    This reproduces the missing capability, not a fix or a production delivery test.

    I also inspected, but did not build or run, rust-v0.169.0: ThreadResumeParams still has no raw-event opt-in, and the cold-resume listener attachment still passes false. Upgrading the native executable alone is therefore not a qualified solution on this evidence.

    The unresolved requirement remains identity-preserving resume opt-in, including cold resume and an initially-disabled loaded rejoin, with existing experimental/default-false/enable-only semantics. Fresh-thread history injection changes identity and is not equivalent for retained parent/child ownership.

    Could maintainers reopen this issue for that remaining case? OpenClaw's consumption-receipt integration still needs positive native sampling acknowledgment; generic turn completion must not retire an unseen child result. Related: openclaw/openclaw#156070 and the explicitly blocked draft openclaw/openclaw#186128.

    No claim is made that every historical OpenClaw handoff failure shares this cause. This probe does not exercise child spawning, native preemption/compaction, WebSocket inference, a patched executable or end-to-end external delivery.

  7. budzation commented on Nov 16, 2026

    @budzation

    Same-ID resume: isolated candidate verification and proposed approach

    Following up on the unmodified 0.164.0 probe with new producer-side evidence, not a production-deployment claim.

    A source-built candidate based on openai/codex@6aaac694803004a63c6f393d153c96d22521a6b9 (0.164.0) preserves the thread ID and enables the missing notifications on both cold resume and an initially-disabled loaded rejoin. The proposed change is to add experimental thread/resume.experimentalRawEvents, pass it to cold listener creation, and use the existing enable-only subscription operation when rejoining a loaded thread. Omitted/false retains the ordinary cold default and does not turn off an already-enabled loaded subscription. No fork/history identity substitution is involved.

    Reference diff: budzation@66183e5

    This is a reference for the issue's root-cause/design discussion, not an external PR submission. The repository's issue-first/no-external-PR contribution policy is respected.

    New isolated evidence

    • The actual patched app-server executable was built and exercised against a synthetic local HTTP/SSE Responses provider in a fresh user/network namespace with loopback only. No credentials, external inference, production Gateway, or user conversations were used.
    • All 13 producer scenarios passed: fresh enabled/disabled controls; loaded enable-only rejoin; same-ID cold opt-in; omitted/false preservation; and no successful rawResponse/completed sampling acknowledgment on provider failure or interruption. These are standalone app-server probes, not the entire repository's integration suite.
    • codex-app-server-protocol: 320 tests passed, 0 failed, 1 generation fixture intentionally ignored. Three new protocol tests cover default wire/experimental behavior, true opt-in, and explicit false.
    • The generated experimental schema is included in the reference commit. Stable schema output was unchanged.
    • The reference commit excludes local build-only lockfile normalization: the released source's workspace version stamps were normalized for the local build; all 1,308 external package selections remained unchanged. That build-only lockfile change is not proposed upstream.

    Limits and remaining need

    This candidate covers thread/resume, not thread/fork, and was tested at the pinned 0.164.0 source base, not current main. It does not prove OpenClaw custody recovery, native child/preemption behavior, WebSocket inference, scheduler retry reconciliation, crash recovery, external delivery, or exactly-once publication. The companion OpenClaw consumer remains draft-only and cannot pass its full strict build in the available incomplete SDK environment.

    Could the same-ID cold-resume and initially-disabled loaded-rejoin requirement be reconsidered on this evidence? Successful native sampling acknowledgment is necessary for consumers that must not mark an unseen child result consumed merely because a turn ended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app-serverbugsession

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions