Repository navigation
e2e hermes: the owner's ledger is read once each call's charge has landed - #788
Merged
Merged
Conversation
…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
approved these changes
Oct 31, 2026
alexlwn123
left a comment
Collaborator
There was a problem hiding this comment.
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.
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.
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-ledgerqueue (cell/src/meter.rscharge), 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'sPOST /api/test/ledgerbefore the queue's firstQUEUE fragment-ledger 3/3delivery, 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'sTURNbound). 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