fix: keep the retry interval in the human message #12
No reviewers
Labels
No labels
waiting-on-julian
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jlxq0/hevy-mcp!12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/keep-the-retry-sentence"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A regression I introduced in #10 and found by running the production check rather than by reasoning about the diff.
0.4.1collapsed the local rate limit's human message into its machine code.structured_errortook one string and used it for both the JSON-RPCmessageanddata.code, so a message that had been a sentence became a token. Read off the deployed binary, ninety concurrentcount_workoutsagainst production:It used to be
"rate limit exceeded; try again in a minute".The class and the code are correct and a caller matching
data.classis unaffected, which is why every test passed. What was lost is the sentence a human reads in a log, and with it the only place the retry interval is stated anywhere in the response.structured_errornow takes the condition and the message separately.The test that would have caught it
Verified by removal. Collapsing them again turns
a_rate_limit_never_arrives_as_an_empty_readred and quotes the message back:Worth naming as a class: the tests from #10 assert the machine-readable fields, because those were the defect. A human-readable field with nothing asserting it is free to degrade under a refactor that is correct about everything a test looks at, and that is exactly what happened here, one release later, in the change that added the tests.
Verification
Gates on 1.98.0 through the build slot:
fmt,clippy,test(48 passed),audit,deny.0.4.1 collapsed the local rate limit's message into its machine code. It had been 'rate limit exceeded; try again in a minute' and became the bare token 'rate_limited', because structured_error used one string for both the JSON-RPC message and data.code. Measured on the deployed binary, not inferred: {"code":-32029,"message":"rate_limited", "data":{"class":"rate_limited","code":"rate_limited"}} The class and the code are right and a caller is unaffected. What was lost is the sentence a human reads in a log, and with it the only place the retry interval was stated. structured_error now takes the condition and the message separately, and a test pins the message: it must contain the interval and must not equal data.code. Collapsing them again turns it red, quoting the message. Nothing else changes. 0.4.2. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NCiHcHN6LrhiuLXbG9SBYG