Skip to content

docs(debug-tend-run): fix codex message content-item jq path - #771

Merged
max-sixty merged 1 commit into
mainfrom
fix/codex-logs-content-shape
Jul 12, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/codex-logs-content-shape

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Nightly survey found an internal inconsistency in the Codex log-parsing reference: the prose description of a message item's text location contradicts the working jq recipe further down the same file.

  • Line ~11 said text lives at .payload.content[].input_text.text — a nested input_text object shape.
  • The recipe under "Initial prompts" uses .payload.content[] | select(.type == "input_text") | .text — a flat, type-tagged shape.

A reader who follows the prose path gets null. The flat shape is correct: Codex's ContentItem enum is internally tagged, so each content item serializes as {"type": "input_text", "text": "…"}.

Source: codex-rs/protocol/src/models.rs —

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, JsonSchema, TS)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ContentItem {
    InputText { text: String },
    ...
}

#[serde(tag = "type", rename_all = "snake_case")] produces {"type": "input_text", "text": ...}, not {"input_text": {"text": ...}}.

This fix aligns the prose with the working recipe. Pure documentation change — no test feasible.

The prose described text at .payload.content[].input_text.text (nested
shape) but the working recipe uses the flat type-tagged shape. Codex's
ContentItem enum is internally tagged (serde tag = "type"), so items
serialize as {"type": "input_text", "text": ...}. Align the prose.
@max-sixty
max-sixty merged commit 4eee964 into main Jul 12, 2026
5 checks passed
@max-sixty
max-sixty deleted the fix/codex-logs-content-shape branch July 12, 2026 08:55
@max-sixty max-sixty mentioned this pull request Jul 16, 2026
2 of 3 tasks
max-sixty added a commit that referenced this pull request Jul 16, 2026
## Summary

Version bump + CHANGELOG for 0.1.11. See
[CHANGELOG.md](https://github.com/max-sixty/tend/blob/release/CHANGELOG.md#0111)
for the full notes.

13 commits since 0.1.10:
- Adopter sandbox levers (`sandbox_path`/`sandbox_env`/`sandbox_setup`,
#768)
- Sandbox `PATH` derived from the runner's own `PATH` (#767)
- Invited upstream contributions (#770)
- `tend-mention` self-comment no-op skip (#751)
- Actionable self-review handling (#762, #775)
- `tend-outage` dedup self-heal (#744)
- Dropped-cron-tick recovery in `list-recent-runs` (#753)
- Drop self-authored attribution sign-offs (#773)
- Docs fixes (#776, #771)
- `claude_version` bump (#774)

## Test plan

- [x] `wt test` (275 passed)
- [x] `pre-commit run --all-files` (all hooks passed)
- [ ] CI green on this PR

> _This was written by Claude Code on behalf of Maximilian Roos_
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.

2 participants