docs(core): note CHAT_LLM_CALL_DEADLINE_MS lockstep with turn wall-clock#287
Open
yerzhansa wants to merge 1 commit into
Open
docs(core): note CHAT_LLM_CALL_DEADLINE_MS lockstep with turn wall-clock#287yerzhansa wants to merge 1 commit into
yerzhansa 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.
What
Adds a two-line invariant comment above
CHAT_LLM_CALL_DEADLINE_MSinpackages/core/src/llm.ts. Comment-only — no behavior change.Why
Follow-up cleanup surfaced by a
/simplifypass over #286. After that change,CHAT_LLM_CALL_DEADLINE_MS(600k) exactly equalsTURN_WALL_CLOCK_MS(10 × 60k) and is silently coupled to it: every chat call's effective deadline ismin(CHAT_LLM_CALL_DEADLINE_MS, turnBudget.remainingMs()), andremainingMs()is always<= TURN_WALL_CLOCK_MS. So the chat cap only binds whileCHAT_LLM_CALL_DEADLINE_MS <= TURN_WALL_CLOCK_MS— raise it above the wall-clock and the bump is inert; drop the wall-clock below it and chat is silently shortened.That invariant previously lived only in #286's commit message and changeset body (the changeset is consumed/deleted at the next version-bump), leaving no in-code record for a future maintainer editing either constant.
Deliberately a cross-reference comment, not a code coupling: importing
TURN_WALL_CLOCK_MSintollm.ts(to derive or assert) would add a wrong-direction dependency edge from LLM dispatch into the agent turn-budget for a rarely-changing constants pair.Test plan
No behavior change (comment only). Mechanism verified by reading the dispatch site (
llm.tsgenerate()Math.minclip), both chat call sites incoach-agent.ts, andremainingMs()inagent/turn-budget.ts.