Repository navigation
feat(site): show a divider for token-budget context windows - #316
Conversation
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
@codex review |
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dafc986c7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 240adc690d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Merged as 5d0cc97 (squash) at 09:24Z. Before the merge, the server was confirmed on the previous deploy, b79366f. Gates on head 19d7020:
Not exercised: a live rollover on a running server in a real browser, and visual snapshots of the stories. This closes #283. |
Closes #283
This is the last part of #283. A token-budget rollover now shows as a divider line in the conversation instead of the "Summarized" card.
Backend
coderd/x/chatd/chatloop/fork_context_window.go:ContextWindowBoundary{id, trigger}and the triggersnew_contextandcontext_limit.chatloop/compaction.go: one line, theContextWindowfield ofCompactionResult.fork_token_budget.go:contextWindowRolloversets the field. The trigger isnew_contextwhen that call succeeded in the prompt window, elsecontext_limit.withContextWindowResultadds it ascontext_windowto the streamedchat_summarizedresult.message_conversion.go: one hook line adds the same field to the stored result.UI
ForkContextWindowDivider.tsx:withForkContextWindowwraps the upstreamchat_summarizedrenderer. Withfork-token-budgeton and a result that holdscontext_window, it renders "Context window w:2 started at the agent's request" or "... at the context limit" between two separators. Otherwise, or on an error, it renders the upstream card.Tool.tsx: one import line and one changed line in the renderer map.Docs
docs/fork/pstack-adapter.md: the Context windows section names the divider, and the evidence lines list the new files and the updated line numbers.coderd/x/chatd/ARCHITECTURE.md: the Context windows bullet describes the field.Tests
flock ~/.fork-go.lock go test -count=1 ./coderd/x/chatd/...: pass.TestTokenBudgetWindowschecks the stored result:{w:2,new_context}for the cooperative path,{w:2,context_limit}for the forced rollover, and no field with the experiment off. Without themessage_conversion.gohook line the first two fail.PlanModeSummarizeschecks that a summary has no field.TestContextWindowRolloverStreamsWindowchecks the streamed result and fails without the wrapper on the streamed part.TestWithContextWindowResultcovers the nil,null, non-object and replace paths.flock ~/.fork-go.lock go build ./coderd/..., the new-code golangci-lint (0 issues),make lint/emdash lint/markdown lint/architecture lint/agents: pass.pnpm test src/pages/AgentsPage/components/ChatElements/tools/: 24 files, 328 tests pass, includingForkContextWindowDivider.test.ts.vitest --project=storybook ForkContextWindowDivider.stories.tsx: 6 stories pass (NewContext, ContextLimit, UnknownTrigger, NarrowPane, ExperimentOff, ErrorResult).pnpm check,pnpm format,lint:types,lint:circular-deps,lint:compiler: pass.knipreports nothing for these files.lint:oxlintandlint:design-systemfail on main already, inForkWaitForEventsTool.tsxanduseForkWorkflowsTab.test.tsx, which this PR does not touch.Tool.tsxline references inpstack-adapter.mdthat the new import line shifted. They are fixed, and its test nits are addressed.Not verified
estimated_context_tokens, which this PR does not change.