fix(runtime): make Moltnet sends reach the network and meter codex turns - #5
Open
apresmoi wants to merge 1 commit into
Open
fix(runtime): make Moltnet sends reach the network and meter codex turns#5apresmoi wants to merge 1 commit into
apresmoi wants to merge 1 commit into
Conversation
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.
Three defects that together made the Clank & Slop organization mute and its
usage ledger empty. All three were found by running the deployed organization,
and all three are proven fixed by a live cascade: brass sent to
room:assignment,the mention woke cogsworth, and both wakes appear in the fuse admission ledger
and the turn-usage ledger.
1. Moltnet identifiers were rejected as scoped agent ids (P0)
productionAgentTools.tsminteddaimon:<sha256>forcorrelation_idanddelivery_id. Moltnet's machine protocol refuses any identifier that parses asa scoped agent id, and
ParseScopedAgentIDtreats everyleft:rightstringas one. Every
moltnet_sendan agent ever attempted failed witherror: invalid request, on every engine.Reproduced directly against the shipped
moltnetbinary inside the runningcontainer: the
daimon:-prefixed request exits 1 witherror: invalid request,the identical request with a colon-free id is accepted.
Fixed by prefixing with
daimon-.2.
moltnet machinewas cancelled by its own caller (P0)machine()wrote the request withchild.stdin.end(...).moltnet machinetreats end-of-input as cancellation of everything in flight, so the send was
cancelled before it completed and the CLI answered
{"error":{"code":"canceled"}}. Confirmed by holding stdin open for the samerequest, which is accepted and returns a real
message_id.Stdin is now held open until the response line arrives.
The test fake previously waited for stdin
endbefore answering, which isexactly the shape that hid both defects. It is replaced by
src/runtime/fixtures/testMoltnetMachine.mjs, a faithful stand-in that refusescolon-bearing ids and cancels on EOF.
3. Codex turns were never metered (P1)
decodeCodexTurnUsagerequiredcache_write_input_tokens. Codex 0.142.3 (inthe runtime image) and 0.151.0 (on the host) both emit only
input_tokens,cached_input_tokens,output_tokensandreasoning_output_tokens, so everyreal turn decoded to
usage: undefinedand the codex half of the usage ledgerrecorded nothing — while the suite stayed green against a fixture that invented
the field.
The field is now optional (absent means zero); present-but-malformed still
degrades the whole block, as before.
Verification
stdin.end(request)→ red; makingcache_write_input_tokensrequired again →red. Restored → green.
/v2/wakeson the deployed organization produced amoltnet_send, a mention-driven wake of a second agent, two admission-ledgerlines and two turn-usage lines. All four were zero before this change.