Repository navigation
interactive harness: fix double-iterator in token-usage jq parser - #616
Merged
Merged
Conversation
Smoke 4 (run 26490407419) succeeded end-to-end but still reported
0 turns. Root cause: `jq -s '[.[] | .[] | select(.message.usage)]'`.
`jq -s` slurps all input files into ONE flat array of events. The
second `.[]` tried to iterate event objects (yielding their values),
hitting "Cannot index string with string 'message'" on the first
non-object value. The `|| echo '{}'` swallowed the error, the step
fell through to zeros, and the warning fired.
Verified against the actual smoke 4 session JSONL: the fixed parser
returns `{input_tokens: 5, output_tokens: 269, cache_creation: 14531,
cache_read: 44341, turns: 3, ...}`.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
tend-agent
approved these changes
May 27, 2026
Merged
max-sixty
added a commit
that referenced
this pull request
May 27, 2026
## Why Cut the 0.1.2 release so consumer repos (and tend's own nightly regen) pick up the new `claude-interactive` harness and per-workflow `harness`/`model` overrides. ## What's new since 0.1.1 **New `claude-interactive` harness** (`max-sixty/tend/[email protected]`) — opt-in alternative to the released `claude` harness. PTY-supervised interactive `claude` via `script(1)`, end-of-turn detected through Stop/StopFailure hooks. Built as the trial path ahead of Anthropic's June 15 billing split between Agent-SDK metering and the flat Claude Code subscription. Smoke tested end-to-end on tend itself. PRs: #609, #611, #613, #614, #615, #616. **Per-workflow `harness` / `model` override** — adopters can flip a single workflow to a different harness or model without changing `.config/tend.yaml` defaults. #612. **Skill refinements** — nightly upstream-bot rebases (#605), running-in-ci PR bar (#604) and recheck (#573), env-filter loophole fix (#599), authorAssociation warning (#600), review-gates Gate 1 (#602). **Bug fix** — mention queue-delay now uses `comment.updated_at` so edit events report accurately (#595). ## Compatibility Released `claude` harness path is byte-identical; `claude-interactive` is strictly additive and opt-in. Consumer repos that don't touch `harness:` see no change beyond the new skill text and the mention-edit fix.
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.
Why
Smoke 4 (https://github.com/max-sixty/tend/actions/runs/26490407419) succeeded end-to-end — Stop hook fired, claude responded
Smoke test ran at 2026-05-27T04:16:42Zin 8s — but the token-usage step still reported0 turns, even after the-newerfilter fix in #614.Root cause is the jq filter itself:
jq -sslurps all input files into ONE flat array of events. The second.[]tried to iterate event OBJECTS (yielding their values, not events), which hitCannot index string with string "message"on the first non-object value. The|| echo '{}'swallowed the error and the step fell through to zeros.Verified against the actual smoke 4 session JSONL (downloaded from the run's artifact):
Cannot index string with string "message"{}fallback){"input_tokens":5,"output_tokens":269,"cache_creation_input_tokens":14531,"cache_read_input_tokens":44341,"turns":3,"model":"sonnet","cost_usd":0}What
Single fix: drop one
.[]from both the$msgsaccumulator and the turns count. Add a comment so future-me doesn't make the same mistake.