Repository navigation
web/openai-codex-search-llm-request events make sessions unloadable after restart #24
Description
web/openai-codex-search-llm-request events make sessions unloadable after restart
Summary
Every Codex standalone web search appends a web/openai-codex-search-llm-request
session event to the initiating agent's session log (src/search-event.ts →
recordOpenAICodexSearchRequest). That event type is not in the Harness
core's frozen v0 migration vocabulary, so after any Harness restart the
session can never be observed again:
Failed to load history: failed to observe session "session-bbb17e99-…":
format v0 contains unknown historical event type
"web/openai-codex-search-llm-request" at seq 381;
migration refuses unknown historical events even when ignorable;
source v0 artifact remains unchanged (gateway/internal)
The session data itself is intact (the migrator is non-destructive and the raw
session.jsonl.zstd stays fully readable) — but the UI, and anything reading
through sessionPersistence (e.g. usage-dashboard backfill), can never open
that session again. In my deployment 6 of 26 sessions are affected, all under
one cwd, each containing a handful of these events (9 in the largest log, at
seqs 381–383, 1577–1579, 1877–1879 out of ~37k events).
Root cause (verified against installed code)
- Writer:
dsh-codex@0.2.7src/search-event.tsregisters the type only in
the runtimeKNOWN_SESSION_EVENT_TYPESset (installOpenAICodexSearchEvent),
which covers live in-process reads. - Reader/migrator:
@deepseek-ai/dsh-session-format-v0-to-v1(and the copy
bundled in@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs)
validates every historical event against the frozen
RELEASED_V0_EVENT_DISPOSITIONStable (51 types). That table contains the
siblingweb/deepseek-search-llm-requestbut not
web/openai-codex-search-llm-request, andassertReleasedEventPayload
throwsSessionFormatUnsupportedMigrationErrorfor any unknown historical
type unconditionally ("even when ignorable"). The v1→v2 stage
(transformReleasedEvent) refuses unknown types the same way, and
RELEASED_V0_EVENT_DISPOSITIONSisObject.freezed, so there is no
runtime registration path for the migration. - The old Harness process kept working because the sessions were already
observed before the search events were appended; the restart forced a fresh
v0→v1 migration and exposed it. So this bites on every restart for any
session that used Codex web search — the poison accumulates silently while
running and detonates on reboot.
Versions (all latest at time of writing — no update fixes it)
@deepseek-ai/dsh0.1.5-rc.1,@deepseek-ai/dsh-session-format-v0-to-v1
0.1.5-rc.2(newest on npm; table still lacks the type)dsh-codex0.2.7installed;0.2.9(newest on npm) still writes the
event identically (src/search-event.tsunchanged)
Suggested fixes (maintainer's pick)
- Stop writing the event to the session log by default (or gate it behind a
config flag, e.g.searchRecordRequest: false), keeping the request data
in memory/opaque diagnostics instead; or - Write it with
ignorable: trueand coordinate with core so the
migrator tolerates ignorable unknown types (currently it refuses them even
when ignorable); or - Upstream the event type into core's frozen disposition table (core change).
Option 1 alone un-bricks all future sessions; already-written logs stay
unopenable until core learns the type, so users with affected sessions still
need (a core-side allowance or) a repair path.
Workaround for affected users
None that preserves the log: relabeling to web/deepseek-search-llm-request
fails its exact deepSeekSearchBodyValue shape, and every other known type
has a strict payload disposition plus later-stage (v1→v2 turn-tracking)
invariants. I recovered my conversations by extracting user/assistant text
from the raw zstd logs (read-only). To stop new poison I would have to pin
web.searchProvider: deepseek-official (whose pre-dispatch event is in the
frozen table) — but that backend needs a DEEPSEEK_API_KEY I don't have, so
currently there is no prevention that preserves working search.
Activity
GrecAndrei commentedon Sep 11, 2026
Follow-up: 0.2.9 fixes a second, more severe incompatibility I hit while verifying this issue — every Codex turn failed with
Cannot read properties of undefined (reading 'get'). Root cause: 0.2.7 builds its pi-ai profile object withoutmodelErrors, which core 0.1.5-rc.x'smodelOfunconditionally reads (profile.modelErrors.get(model)). 0.2.9'smodelErrors: new Map()resolves it; verified a working turn after upgrading. The session-log poison described above is unchanged in 0.2.9 (search-event.ts identical), so this issue stands.Yan-Zero commentedon Sep 13, 2026
Thank you for tracing this all the way through the frozen historical event vocabulary and for documenting the affected-session behavior so precisely.
This is fixed in dsh-codex 0.3.0 via #26:
web/openai-codex-search-llm-requestinto the Session; durable search history remains represented by Harness's existingtool/callandtool/resultevents;With every dsh process using the Session root stopped, preview first:
dsh plugin --profile web exec dsh-codex repair-sessionThen apply the reviewed migration:
dsh plugin --profile web exec dsh-codex repair-session --applyThe command scans
$DSH_HOME/sessionsrecursively by default, validates each retired payload exactly, writes a new current v3 generation, and retains every historical source unchanged. A directory or exact generation path can also be supplied to narrow the scan.The 0.3.0 release has been published successfully, so I am closing this as completed.