[codex] Fix runner trace matrix and Hermes detection#6
Merged
Conversation
Bump Teich to 0.1.4 for a patch release covering trace detection and runner conversion fixes. Changes: - recognize Teich-exported Hermes external traces as Hermes while preserving the raw source metadata - keep Codex conversion metadata aligned with public detection by using trace_type=codex and source=exec - resume Claude Code follow-up turns by native session id instead of plain --continue to avoid synthetic continuation prompts - chmod mounted workspaces before external-runner sandbox snapshots - add a generated Hermes example using the first prompts.jsonl row, including its follow-up turn - add regression coverage for Hermes detection/conversion, Codex metadata, Claude follow-up resume, and workspace chmod Validation: - live runner matrix passed for chat, hermes, claude-code, pi, and codex using google/gemini-3.1-flash-lite via OpenRouter - matrix validation confirmed detection/conversion output, one converted row, turn_count=2, and both prompt turns for every supported runner - uv run pytest: 345 passed, 21 skipped - uv run ruff check . - uv run python -m compileall -q src tests - git diff --check - uv build - uv pip check
armand0e
marked this pull request as ready for review
June 11, 2026 03:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This patch release fixes the trace detection/conversion issues uncovered while testing the same two-turn prompt across every supported generation path.
0.1.3to0.1.4inpyproject.toml,src/teich/__init__.py, anduv.lock.external_session_metawithsource: hermes-agent) ashermes, while still preserving the raw source metadata.trace_type: codexand keeps Codex's native source separately assource: exec.--resume <sessionId>) instead of plain--continue, preventing Claude Code from injecting a synthetic "Continue from where you left off" turn and replaying the initial prompt./workspacebefore sandbox snapshotting, fixing permission-denied failures after Hermes/Claude follow-up turns create files.examples/prompts.jsonlrow, including its follow-up prompt.Root Cause
The live runner matrix exposed three issues:
external_session_metaevents withsource: hermes-agent, but detection classified that shape as genericexternal_agent.--continue, which can add an implicit continuation prompt and replay the original prompt before the real follow-up. Using the native session id with--resumepreserves the intended prompt sequence.source: execto describe Codex CLI mode, not trace type. Conversion was surfacing that asmetadata.trace_type, which made converted metadata disagree withdetect_trace_type().Validation
chat,hermes,claude-code,pi, andcodexusinggoogle/gemini-3.1-flash-litevia OpenRouter.turn_count=2and includes both the initial prompt and follow-up prompt.uv run pytest-> 345 passed, 21 skipped.uv run ruff check .uv run python -m compileall -q src testsgit diff --checkuv builduv pip checkNotes
chatoutput is already structured training data, sodetect_trace_type()correctly returnsNonefor that file while conversion still accepts it astrace_type: chat.