Skip to content

e2e hermes: the owner's ledger is read once each call's charge has landed - #788

Merged
futurepaul merged 1 commit into
masterfrom
claude/hermes-ledger-charge-wait
Oct 31, 2026
Merged

futurepaul merged 1 commit into
masterfrom
claude/hermes-ledger-charge-wait

Conversation

@futurepaul

Copy link
Copy Markdown
Collaborator

Flake: hermes' "and each is charged on its owner's ledger" failed with []. Run alone on master (cargo xtask e2e --only hermes, 5ea1a09) it failed again here: 68 passed, 1 failed.

Cause (test): a model call is charged after its answer. The charge goes through the fragment-ledger queue (cell/src/meter.rs charge), whose consumer batches for up to 1 s (max_batch_timeout: 1). The check read the owner's ledger once, right after the turn. The node log shows the check's POST /api/test/ledger before the queue's first QUEUE fragment-ledger 3/3 delivery, so no charge had landed yet. When the whole lane runs, other sections leave time for the batch, which is why it passed there. The vision check later in the section reads the same way (vision_entries).

Fix: both checks wait for the condition itself (s.eventually, the section's TURN bound). The first waits until the owner's ledger has a charged row for each model call made (aig.len() >= calls.len()), which is stricter than before ("not empty"). The second waits until each vision call has its charged row. They wait on the rows, never a fixed time.

Proof: cargo xtask e2e --only hermes: 69 passed, 0 failed (master: 68/1).

🤖 Generated with Claude Code

…nded

A model call is charged after its answer, through the ledger's queue,
whose batch waits up to a second. The hermes section read its owner's
ledger once, right after the turn, and found none of the charges yet
(its node log: the read before the queue's first delivery). Both its
ledger checks now wait for each call's charged row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@alexlwn123 alexlwn123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass at 9783d57f4a4d1e7da08d440eb7d04f9b98cfa435.

Both ledger checks now wait for asynchronous charge delivery using the existing bounded polling helper. The first also requires enough charged rows for the observed calls; the vision check retains its agent/model filter and nonempty-call assertion. This is a small, appropriate test-only fix, with no blocking findings.

Validation: cargo check -p fragment-e2e --locked and git diff HEAD^ HEAD --check passed. Traced the polling helper, ledger readers, and charge queue configuration. CI is still pending; I did not rerun the full Docker/Hermes lane (the PR reports 69/69 passing). The referenced external engineering-style file is unavailable on this machine.

@futurepaul
futurepaul added this pull request to the merge queue Oct 31, 2026
Merged via the queue into master with commit 7074fe2 Oct 31, 2026
12 checks passed
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