Skip to content

debug-tend-run: support Codex logs; instruct Codex to read skills in full - #551

Merged
max-sixty merged 1 commit into
mainfrom
codex-debug
May 17, 2026
Merged

max-sixty merged 1 commit into
mainfrom
codex-debug

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Summary

Two related fixes from investigating why Codex re-posts near-identical reviews on long-lived PRs (e.g. #535).

debug-tend-run now supports both harnesses. The artifact download pattern matches claude-session-logs* and codex-session-logs-*; per-harness JSONL parsing recipes moved into references/claude-logs.md and references/codex-logs.md, loaded on demand. SKILL.md is now a thin harness router. All Codex jq recipes were validated against real PR #535 session logs.

Codex is told to read skills in full. Codex has no skill-loading tool: it seds SKILL.md files, and its own injected instruction ("read only enough to follow the workflow") makes it stop at a prefix. In all four PR #535 review runs it read only lines 1-220 of the 602-line running-in-ci, missing the dedup rule at line 310 that prevents the repetitive "prior thread still applies" preface. The truncation was verified to be the model's own choice, not a hard context or output cap (no skills-budget event fired; the read ended cleanly under the token cap). codex/agents-tail.md now carries an explicit directive to cat each tend SKILL.md in full, overriding the generic "read only enough" guidance.

This is a mitigation, not a structural fix: running-in-ci stays a single 602-line file. The directive is a soft override of OpenAI's built-in behavior. If repetition persists, the next lever is shortening running-in-ci or moving the dedup rule earlier in the file.

Test plan

  • debug-tend-run Codex recipes produce correct output against a real codex-session-logs-* artifact
  • A Codex CI run reads running-in-ci in full (cat, not sed -n '1,Np') after this lands
  • Repetitive-review behavior on long-lived PRs no longer recurs

… in full

Generalize the debug-tend-run skill to both harnesses: the artifact
pattern now matches claude- and codex-session-logs, and per-harness
JSONL parsing recipes move into references/{claude,codex}-logs.md
(loaded on demand). Codex recipes validated against real session logs.

Investigating PR #535's repetitive reviews showed Codex reads bundled
SKILL.md files with a truncating `sed -n '1,Np'` prefix (its own
"read only enough" instruction), missing load-bearing rules in the
tail of long skills like running-in-ci. Add an explicit directive to
codex/agents-tail.md to read each tend SKILL.md in full with `cat`.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit e7de54d into main May 17, 2026
6 checks passed
@max-sixty
max-sixty deleted the codex-debug branch May 17, 2026 00:32
max-sixty added a commit that referenced this pull request May 17, 2026
)

## Summary

Fixes the root cause of tend re-posting near-identical "Not approving;
the prior thread still applies" reviews on every push to a long-lived PR
(observed on #535).

`review/SKILL.md` contained two instructions that contradicted each
other on a non-trivial push with no new findings:

- The dedup rule (sibling-workflow dedup from `running-in-ci`): omit
already-covered points, stick to diff-grounded findings.
- The posting rule: "Post exactly one review per run. Always give a
verdict."

So when a push was non-trivial (skipping the trivial-diff early-exit)
but introduced no new finding, the reviewer still posted a fresh review
whose entire content restated an already-blocking unresolved thread.

Both rules are now reconciled into one decision: after dedup, if there
is no new diff-grounded finding on the incremental changes and the only
outstanding concern is a still-unresolved prior bot thread, post
nothing. That thread already blocks the PR; the earlier review stays the
active verdict. A fresh review is warranted only when the incremental
diff adds a finding or resolves the last open one (then approve with an
empty body).

This is harness-independent. It complements #551 (which stopped Codex
truncating long skills) by removing the ambiguity that produced the
behavior in the first place, so it holds even when the full skill is
read.

## Test plan

- [ ] On a long-lived PR with an unresolved bot thread and a non-trivial
push that adds no new finding, the reviewer posts no new review and the
prior thread still blocks
- [ ] A push that introduces a new finding still produces a COMMENT
review
- [ ] A push that resolves the last open concern still produces an
empty-body APPROVE

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@max-sixty max-sixty mentioned this pull request May 17, 2026
3 tasks
max-sixty added a commit that referenced this pull request May 17, 2026
## Summary

Release 0.0.24. 11 PRs since 0.0.23:

- #545 Rewrite the workflow generator on Jinja2 templates
- #546 generator: switch build backend to uv_build
- #544 generator: route install-test through `_apply_extras`
- #535 install-tend: unify on the chain model (admin-gated refs + env
policy pin)
- #537 review-reviewers: migrate to the Codex harness
- #551 debug-tend-run: support Codex session logs; instruct Codex to
read skills in full
- #552 review: stop re-posting "prior thread still applies" on every
push
- #547 fix(stats): stop blacking out the section on transient worker
outage
- #548 site: simplify "currently tending" to a prose repo list
- #549 site: refresh "currently tending" on a 30s timer
- #550 site: refresh Stats and Activity on a timer

#551 and #552 are the reason for cutting now: together they stop the
Codex harness re-posting near-identical "the prior thread still applies"
reviews on every push. The behavior is release-gated, so it only reaches
tend's own dogfooded workflows once 0.0.24 is published and the nightly
regen repins the action ref.

No new breaking changes since 0.0.23 (the `TEND_BOT_TOKEN` rename
shipped in 0.0.23).

## Test plan

- [ ] CI green (test, test-worker, lint)
- [ ] After merge: tag `0.0.24`, PyPI publish (`pypi-release.yaml` on
the tag push), `uvx [email protected] --help` works
- [ ] Regenerate tend's own workflows to `@0.0.24` (separate `chore:
regenerate` PR, after the tag exists)

Co-authored-by: Claude <[email protected]>
max-sixty added a commit that referenced this pull request Nov 27, 2026
… harness meets them (#1751)

Follows #1676: tend's instructions should say what a session must
achieve and leave out how a harness gets it there, since harness
mechanics go stale between releases. This removes six passages that
describe harness mechanics, and adds the rule that keeps new ones out.

- **The `.claude/skills/` write workaround** in propose-instructions and
review-runs (read-only mount, harness write-guard, write to `$TMPDIR`
then `mv`) no longer holds. anthropics/claude-code#37157 was fixed in
2.1.126 and tend pins 2.1.330. A probe on 2.1.332 wrote into
`.claude/skills/` with no denial, and the mount went with the sandbox
runtime in #1354. If that probe misled us, the edit fails visibly.
Tend's own running-tend overlay loses its pointer to the workaround too.
- **ground-claims' 32 KB threshold** was measured on Claude only. The
rule to project narrowly stays.
- **run-tend's "the harness does not load them…" clause** explains a
rule that stays.
- **Three asides** that the tools' own descriptions already carry.

propose-instructions' "What the text carries" gains the rule.
AGENTS.md's "Mechanics ship freely" narrows to match: it is the clause
that let #1676's first draft through.

Kept: Codex's `yield_time_ms` waits (#1448, #1641), reading skills in
full with `cat` (#551), absolute paths for file-writing tools, and the
command timeouts.

pre-commit passes locally; CI runs the suite.

> _This was written by Claude Code on behalf of max-sixty_
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