GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — codex-proxy: warm app-server daemon transport as lead route (#480) by dezren39 · Pull Request #773 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Oct 24, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Stacks on #766 (branch base is warm/codex-proxy-sessions tip 6f0a33c; merge #766 first or this PR's diff against main includes it).

What

codex-proxy gains an app-server transport as the default lead route: one persistent WebSocket-over-Unix-socket connection to the managed codex app-server daemon (~/.codex/app-server-control/app-server-control.sock). Conversations map to daemon threads with the same keying (sha256 model/effort + system + first user msg), prefix validation, persisted map (sessions.json, LRU 64 / 2h TTL) as the #766 resume build; keyed turns send only the new tail via turn/start; deltas stream as SSE; usage maps from thread/tokenUsage/updated (last).

CODEX_PROXY_TRANSPORT=app-server (default) | exec-resume | exec. Any app-server failure before response commit (daemon down, thread lost, RPC error, daemon death mid-turn) falls back to exec-resume → exec, with one reconnect attempt first. A request never fails because the warm route failed. syncCodexTokensToOpenCode() preserved.

Connection mechanics, evidenced on the laptop daemon (0.164.0, ChatGPT login): control socket is WebSocket-over-UDS — HTTP Upgrade handshake (101) then JSON-RPC text frames (client frames masked). The stdio bridge codex app-server proxy was tried first and never answered an initialize in 180s against this daemon; the direct socket answers instantly and needs no per-request (or any) child process.

Measurements — all gpt-5.6-luna, same two-turn script (WARM1/WARM2)

route turn 1 turn 2
raw app-server floor (direct WS client) 14.44s (+5.09s thread/start) 2.15s
exec-resume proxy (#766, re-measured) 46.07s 56.07s
native reference (Drew) ~22s class —

Full proxy timings (3 turns) and the daemon-blocked fallback proof are in the #480 worker report after live deploy verification.

Tests

node --test bin/codex-proxy.test.mjs — 18/18 pass (10 pre-existing + 8 new: app-server two-turn mapping/tail-only, SSE deltas, thread resume after proxy restart, turn-failure/RPC-failure/daemon-death/unreachable-socket fallback to exec, exec-resume transport bypass). New tests use a fake WS-over-UDS app-server in the suite's existing stub style.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Muse (sandbox agent) and others added 3 commits October 24, 2026 16:08
Muse (sandbox agent)
codex-proxy: warm resumable exec sessions keyed by conversation (#480)
542db84
First turn of a conversation runs codex exec without --ephemeral and
captures the session id from the thread.started JSON event; later turns
run codex exec resume <id> with only the new non-assistant tail.
Key = sha256(resolved model/effort + system prompt + first user message).
Session map persisted to sessions.json in the proxy state dir
(LRU 64, 2h TTL). Any resume failure falls back to a full-history fresh
run and re-keys. syncCodexTokensToOpenCode, endpoint.json, port parsing
and SSE behaviour unchanged.

Tests: 4 new warm-session tests (resume tail-only, resume-failure
fallback, system-prompt change bypass, restart persistence) alongside
the existing #676/#680 failure tests — 10/10 pass.
Muse (sandbox agent)
codex-proxy: exec resume has no --color flag (verified on laptop code…
6f0a33c
…x-cli 0.160.0)

Passing --color to 'codex exec resume' is a clap usage error (exit 2).
Probe on amd: resume with the shared option set minus --color succeeds,
re-emits thread.started with the same thread_id, and answers from the
resumed session.
Muse Sweep
codex-proxy: warm app-server daemon transport as lead route (#480)
77d462a
One persistent WebSocket-over-Unix-socket connection to the managed
codex app-server daemon (~/.codex/app-server-control/*.sock): initialize
handshake once at first use, conversations map to daemon threads with
the same keying/prefix-validation/persisted-LRU discipline as the exec
resume build, keyed turns send only the new tail via turn/start, deltas
stream as SSE, usage maps from thread/tokenUsage/updated (last).

Raw floor on the laptop daemon (0.164.0), gpt-5.6-luna: thread/start
5.1s, turn 1 14.4s, turn 2 2.15s — vs 46s/56s for the exec-resume build
on the same model and script. The stdio bridge (codex app-server proxy)
never answered an initialize against this daemon; the direct control
socket (WebSocket over UDS) answers instantly and needs no child.

CODEX_PROXY_TRANSPORT=app-server (default) | exec-resume | exec.
Any app-server failure before response commit — daemon down, thread
lost, RPC error, daemon death mid-turn — falls back to exec-resume,
then exec; one reconnect attempt precedes the fallback. sync of Codex
tokens to OpenCode preserved unchanged.
@dezren39
dezren39 requested a review from a team as a code owner October 24, 2026 16:39
@github-actions github-actions Bot assigned dezren39 Oct 24, 2026
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 071a01ca-4bc8-493e-84f5-2a9d3c850796
Commits

Reviewing files that changed from the base of the PR and between 3184df6 and 77d462a.

Files selected for processing: 2
  • bin/codex-proxy.mjs
  • bin/codex-proxy.test.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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-24T16:44:00.734408Z 77d462a 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 24, 2026
View reviewed changes

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

Copy link
Copy Markdown

There was a problem hiding this comment.

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: 77d462ae2b

ℹ️ 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".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/codex-proxy.mjs
Comment on lines +637 to +638
client.turnStates.set(threadId, state);
client.rpc('turn/start', {

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 24, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P1 Badge Serialize concurrent turns on the same daemon thread

When two requests concurrently extend the same warm conversation, both reuse its thread ID and the second call overwrites the first call's state here. Notifications are dispatched only by thread ID, so the second request can receive the first turn's answer while the first request never resolves. If the daemon rejects the overlapping turn instead, its failure handler deletes the shared state and still strands the first request. Serialize turns per thread and associate notifications with the accepted turn ID.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/codex-proxy.mjs
Comment on lines +323 to +325
// The session already holds its own assistant replies, so the tail fed
// to `exec resume` is only the new non-assistant turns.
const tailMessages = messages.slice(entry.fedCount).filter(m => m.role !== 'assistant');

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 24, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Validate the assistant reply before reusing a session

When a caller edits the latest assistant response or submits a different conversation with the same system prompt and first user message, prefix validation still accepts the request: fedHashes contains only the previous request's input, not the reply generated afterward. This filter then discards the supplied assistant response, causing the next answer to use the cached session's different history. Record and validate the generated reply as part of the reusable prefix, falling back to full history when it differs.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/codex-proxy.mjs
Comment on lines +337 to +340
sessionId: sessionId || threadId || prev.sessionId,
threadId: threadId || prev.threadId,
fedCount: messages.length,
fedHashes: messages.map(messageHash),

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 24, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Clear the old daemon thread when recording a fresh exec session

If the daemon is unavailable and an edited or truncated history retains the same conversation key but fails planResume, the request takes the fresh exec path. Recording that successful run assigns its new sessionId but preserves the previous daemon threadId, while advancing the stored message hashes. Once the daemon becomes available, a subsequent extension passes prefix validation and sends only its new tail to the old thread, which has a different history. Invalidate the old thread ID when a new exec session replaces it.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/codex-proxy.mjs
Comment on lines +1081 to +1084
res.on('close', () => {
if (!res.writableEnded && currentChild) {
try { currentChild.kill('SIGTERM'); } catch (_) {}
}

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 24, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Cancel the daemon turn when the HTTP client disconnects

When a client aborts a request using the default app-server transport, currentChild is null, so this close handler does nothing and the daemon continues generating an answer nobody will receive. Unlike the previous child-process path, abandoned requests keep consuming inference resources and can subsequently be recorded as successful warm sessions. This was reproduced by aborting after turn/start: no interruption RPC was sent, and the abandoned turn was persisted after completion. Track the active daemon turn and interrupt it on disconnect, without proceeding into fallback execution.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/codex-proxy.mjs
if (typeof params.tokenUsage.last.outputTokens === 'number') state.completionTokens = params.tokenUsage.last.outputTokens;
} else if (method === 'turn/completed' && params.turn) {
client.turnStates.delete(threadId);
if (params.turn.status === 'failed') {

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 24, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Treat interrupted daemon turns as unsuccessful

When a daemon turn is interrupted, this condition falls through to the success branch, returning any partial content with finish_reason: 'stop' and recording the session as successful. The protocol generated by the locally installed Codex explicitly includes interrupted in TurnStatus and permits an error on interrupted turns; passing such a completion through the actual handler reproduced ok: true with an unfinished answer and no error detail. Require a completed status for success and route interruptions through the existing failure or pre-output fallback handling.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/codex-proxy.mjs
}, 60000).catch((err) => state.fail(err));
});

const threadConfig = (effort) => ({ model_reasoning_effort: effort });

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 24, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P1 Badge Preserve the shell-tool restriction in daemon thread configuration

When the daemon has shell tools enabled, the new default transport no longer applies the --disable shell_tool restriction retained in the exec path's commonArgs. Both daemon thread creation and resumption use this config alongside approvalPolicy: 'never' and sandbox: 'danger-full-access', so chat requests can now execute host shell commands without approval. The installed Codex reports shell_tool enabled with an empty configuration, and its --help documents --disable <FEATURE> as “Equivalent to -c features.<name>=false”. Add the equivalent features.shell_tool=false override to the daemon thread configuration.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39 dezren39 mentioned this pull request Oct 24, 2026
Warm-session proxies: hold CLI/language-server sessions open instead of spawning per request #480
Closed
5 tasks done
@dezren39
dezren39 merged commit 447f7ae into main Oct 25, 2026
4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the warm/codex-proxy-app-server branch October 25, 2026 11:42
This was referenced Nov 23, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
AUDIT-7 Lane 2 — Closed-Issues Review (past month, since 2026-10-23) #13878
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dezren39 dezren39

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.