Skip to content

feat(sminos): send reaches a Codex thread through codex's durable queue - #133

Merged
SSFSKIM merged 1 commit into
mainfrom
sminos-codex-queue
Sep 8, 2026
Merged

SSFSKIM merged 1 commit into
mainfrom
sminos-codex-queue

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

sminos send now delivers to a Codex thread when no seat and no live harness session matches: a bare Codex thread id, or any codex:<id|exact name>, goes through codex queue --thread … --message ….

Why the durable queue. It is the only door into a Codex thread from outside its process. The Codex desktop app runs its own app-server stdio-bound to the Electron host, and its send_message_to_thread pipe rejects any process it did not spawn (both a hand-rolled client and the app's own bundled MCP shim were dropped). The queue is a SQLite table every Codex app-server shares; the hosting process reads it between turns.

Semantics, verified live (interactive TUI in tmux; then the shared app-server daemon):

target state what happens
idle dispatched within the host's 10 s poll (instant when in-process)
busy held until the current turn ends, then dispatched
no live process parked; dispatched at the next codex resume

So send never refuses a Codex target for not being live, and reports queued, not sent. The skill carries this in one paragraph so a caller plans the round-trip.

Bare names are not tried. codex resolves an id in ~1 s but pages through the whole thread history for a name (63 s for 7,000 threads, observed); a mistyped seat alias must not pay that. Names go through the explicit codex:<name>.

Tests

tests/sminos/run-sminos-tests.sh: a codex stub in its own PATH dir (shadowing any real codex, which would otherwise start an app-server under the test HOME) and 21 new assertions — no-codex machine, unknown id/name, id delivery, codex:<name>, alias-vs-thread-name precedence, --from, unknown-thread exit 4, other codex failures exit 1 with codex's text. All 559 pass. scripts/lint-shell.sh clean.

Version 7.76.0 in the same commit.

…ueue

When no seat and no live harness session matches, a target that is a Codex
thread id — or any `codex:<id|exact name>` — is delivered with
`codex queue --thread … --message …`. That writes one row to the queue every
Codex app-server shares (~/.codex/queue_1.sqlite); the process hosting the
thread reads it between turns: at once when idle (its host polls every 10 s),
after the current turn when busy, at the next resume when nothing hosts it.
Verified live against an interactive TUI in all three states and against the
shared app-server daemon; it is the only door into a desktop-app thread, whose
app-server is stdio-bound. Because the queue is durable, a Codex target is
never refused for not being live, and the report says `queued`, not `sent`.

Bare names are not tried: codex resolves an id in a second but pages through
the whole thread history for a name (63 s for 7,000 threads, observed), which
a mistyped alias must not pay. The skill carries the semantics in one
paragraph so a caller plans the round-trip. Version 7.76.0.
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