Skip to content

feat: trigger compaction independently for the chat and compaction models - #28568

Merged
ibetitsmike merged 42 commits into
mainfrom
mike/context-window-12v3
Oct 11, 2026
Merged

ibetitsmike merged 42 commits into
mainfrom
mike/context-window-12v3

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Xum (an AI agent) authored this pull request on Mike's behalf.

Summary

Automatic compaction now fires at whichever of two independent triggers is reached first, and the UI shows when the organization override's trigger applies.

  • Chat trigger: the chat owner's personal threshold (or the chat model's) against the chat model's window. A threshold of 100 turns off only this trigger.
  • Organization trigger: a fixed 80% of the organization compaction override model's window. The override model's own compression threshold is ignored. The other 20% is a target margin for the summary prompt and the summary, not a guarantee, because the trigger reads the previous step's prompt size.

On main, the chat threshold was applied to the smaller of the two windows, and nothing in the UI showed it. Example: with a 20K chat model at 70% and an 8K override, main compacts at 5,600 tokens; this PR compacts at 6,400 (80% of 8K, shown as 32%).

Changes

Backend (coderd/x/chatd):

  • The trigger with the lower token point binds (ties go to the chat trigger). It drives the automatic compaction gate and the still-over-limit check, and every summary, automatic or manual, records it.
  • An override that is unset, deleted, disabled, on a disabled provider, or without credentials for the chat owner is treated as absent: the chat model summarizes and only the chat trigger applies.
  • The summary's output cap is bounded by the summarizer's own window, not the trigger's.
  • The still-over-limit error names what can clear it: the compaction threshold (chat trigger), an override model with a larger window (organization trigger), or both when usage is over both points.
  • The still-over-limit check compacts once more when the latest summary was recorded under a different threshold or trigger window. The chat_summarized result gains trigger_context_limit_tokens, and context_limit_tokens now records the chat model's window (main recorded the smaller window). On main, lowering a threshold after a compaction ended every later turn with the error.
  • The still-over-limit check skips a 0% threshold ("always compact"), which on main ended the run with the error after every compaction.
  • ARCHITECTURE.md documents the two triggers, the summary cap, and the still-over-limit rules.

Frontend (site), through a shared compactionTriggers helper that mirrors the backend rules (no new API):

  • Coder Agents settings: the compaction override row warns when the organization trigger undercuts chat models' default triggers ("the organization override compacts chats at 80% of {model}'s {N}-token window").
  • Personal thresholds page: an Effective column shows the trigger that applies, with a popover when the organization override binds. "Compacts at" follows the same trigger, and a point the chat model's window cannot reach shows as Off. The header's 100% sentence, and the row warning when a member types 100, say an organization override may still compact chats when one is set or its organization's overrides failed to load (the header also while they load).
  • Chat context gauge: the compact-at percent follows the binding trigger and is annotated when the organization override binds. If the overrides request fails, it shows the chat-only value with "(organization override not loaded)", or "Compaction off (organization override not loaded)" when the chat trigger is off.
  • An override whose provider the user cannot use is ignored on the gauge and the personal page, matching chatd.
  • The shared formatContextLimit prints counts below 1,000 exactly (an 800-token compaction point showed "~1K") and 999,500 to 999,999 as "1.0M" instead of "1000K". It also labels the model pickers; their other values are unchanged.
  • HelpPopoverIconTrigger lets callers set their own aria-label; only the Effective column's popover does.

Known v1 limits: the Coder Agents settings alert is organization-scoped, so it can warn about an override that some members fall back from for lack of provider credentials. The gauge checks the viewer's provider access, so on a shared chat its label can differ from the owner's runtime trigger (Codex P2, declined). Compaction itself is unaffected.

Screenshots

From remote UAT round 13 on 093076f: an isolated test deployment with a local fake LLM. The models are test fixtures named for their context windows: Chat model 20K (own threshold 70%), Chat model 5K (40%), and Chat model 8K (50%). Chat model 8K is also the organization compaction override, so the organization trigger is 80% of 8,000 = 6,400 tokens, which is 32% of Chat model 20K's window. Chat model 8K's own 50% applies only to chats that use it as the chat model; changing it to 10% or 100% left every value below unchanged.

Coder Agents settings: the organization trigger undercuts Chat model 20K's 70% default.

Override warning: 80% of Chat model 8K's window undercuts Chat model 20K

Personal thresholds: the organization trigger binds Chat model 20K at 32%. Chat model 5K (40%) and Chat model 8K (50%) keep their own chat triggers.

Effective column: 32% from the organization trigger on Chat model 20K
Organization override popover: 80% of Chat model 8K's window, about 32% of this model's window

Personal thresholds, organization settings request failed (the first red line is the injected error). Rows fall back to chat-only values.

Organization settings load failure above usable chat-only rows

Chat context gauge: organization trigger binds (Chat model 20K), chat trigger binds (Chat model 5K), overrides request failed (injected).

Gauge: Compacts at 32% (organization override) Gauge: Compacts at 40% Gauge: Compacts at 70% (organization override not loaded)

Still-over-limit errors from real runs: organization trigger, chat trigger, both.

Organization-only over-limit error
Chat-only over-limit error
Combined over-limit error

Testing

  • Go: TestBindingCompactionTriggerSource, TestCompactionStillOverLimitError, TestCompactionStatusFromHistory, and TestActiveServer_CompactionModelOverride cover the 80% point (fails if the override's own threshold is read again), user threshold 100 leaving the organization trigger on, the summary cap for automatic and manual compaction, the over-limit messages, and recompaction after a trigger change. The site binding tests mirror the Go table row for row.
  • Site: compactionTriggers unit tests and Storybook stories for the three surfaces, including the overrides fetch failure.
  • On c6f8750: go vet, the chatd and chatloop tests, and the AgentsPage, AISettingsPage, and HelpPopover unit tests (2,274 passed, 2 skipped) pass, and CI is green. On 987cefe, tsc, the five affected story files (109 passed), and make pre-commit also passed. 093076f only changes ARCHITECTURE.md; the pre-commit hook's markdown format and lint checks pass on it.
  • On 3cd5b08: tsc, the new formatContextLimit test (fails on the old helper for 800 and 999,999), the compactionTriggers and aiModels unit tests (224 passed), and the affected story files pass, and the pre-commit hook passed on all three commits.

Review record

  • Earlier heads: 12 Codex passes and 3 human reviews, all threads answered. Rebased onto main several times, most recently ff3fa22 (kept refactor(site/src): align compaction settings table #30274, refactor(site/src/pages/AgentsPage): require always-passed settings and misc props #29892, and refactor(site/src/pages/AgentsPage): require always-passed chat input props #29890 in conflicted files).
  • coder-agents-review rounds 1 to 18: findings fixed; approved since round 15. The round 1 ARCHITECTURE.md finding was left for the maintainer, who asked for the update in the last commit.
  • coder-frontend-review (eight roles): all pass. Splitting the PR (RO6) was declined because it is reviewed as one unit; the organizationTriggerFor story helper stays because its three fields must match the model.
  • Design change after UAT round 11: the organization trigger is a fixed 80% of the override window instead of the override model's own threshold (171d5f5, 21d2ce7, 987cefe).
  • coder-agents-review round 19: copy, naming, and an unreachable zero-window gate fixed (6e8efb9, c6f8750). A summary-time fit check with chat-model fallback (CRF-156) was declined: the previous-step lag applies to every trigger, including main's. Round 20 approved c6f8750 with no findings.
  • Codex: one P2 on 987cefe declined (see known limits); no major issues on c6f8750.
  • Remote UAT on dogfood (fake LLM, isolated test deployment): rounds 8 to 13 PASS. Round 12 on c6f8750 first failed one criterion that was written wrong (the admin alert correctly lists an override model that is also a chat model at 100%); the reviewer endorsed PASS on the same evidence after the correction. Round 13 on 093076f retook the screenshots with neutral model names and confirmed that the override model's own threshold (10%, 50%, 100%) does not move the organization trigger.
  • UAT round 13 notes: the header after a failed or pending overrides load and the sub-1K labels are fixed in 4e172ab and d5888ce; coder-agents-review round 21 found the same gap in the row warning (CRF-167, fixed in 3cd5b08). Left as on main: a summary's usage_percent is measured against the binding trigger's window, so it can exceed 100 (nothing reads it), and the 100% help text shows only for an unsaved edit.
  • Codex: no major issues on d5888ce and 3cd5b08. coder-agents-review round 22 approved 3cd5b08 with no open findings.
  • coder-frontend-review on those commits: all roles pass after the fixes. Declined: moving the formatter fix to its own PR (RO5; the owner asked for it here), adding "tokens" to sub-1K labels (TN6; "~800" reads like "~16K"), and splitting the component (RP6).

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c9d5e5fb0

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/AgentSettingsCompactionPage.tsx Outdated
Comment thread site/src/pages/AgentsPage/AgentChatPage.tsx Outdated
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d3b53e70e

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/components/UserCompactionThresholdSettings.tsx Outdated
Comment thread site/src/pages/AgentsPage/AgentChatPage.tsx Outdated
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ff36a0e13

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/compactionTriggers.ts Outdated
Comment thread site/src/pages/AISettingsPage/CoderAgentsPage/OrganizationAgentSettingsView.tsx Outdated
Comment thread coderd/x/chatd/generation_preparer.go Outdated
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a34ac1183

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/compactionTriggers.ts Outdated
Comment thread site/src/pages/AgentsPage/compactionTriggers.ts Outdated
Comment thread site/src/pages/AISettingsPage/CoderAgentsPage/OrganizationAgentSettingsView.tsx Outdated
Comment thread coderd/x/chatd/generation_preparer.go
Comment thread site/src/pages/AgentsPage/compactionTriggers.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 92df70a1b7

ℹ️ 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".

@ibetitsmike
ibetitsmike requested a review from mafredri August 26, 2026 17:20
@ibetitsmike
ibetitsmike marked this pull request as ready for review August 26, 2026 17:20

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5423a3f23

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/AgentChatPage.tsx Outdated
Comment thread coderd/x/chatd/ARCHITECTURE.md Outdated
@coderagents

coderagents Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Check

This PR changes user-facing compaction behavior for the Coder Agents chat feature: compaction now fires at whichever of two independent triggers binds first (chat trigger vs. organization compaction model trigger, lower token point wins), a threshold of 100 disables only its own trigger, and an organization compaction model whose own trigger is disabled (threshold 100) or unreachable (point past the chat window) falls back to the chat model. The published docs do not yet reflect any of these semantics.

Updates Needed

  • docs/ai-coder/agents/architecture.md (Context compaction, ~L86-98) - Currently describes a single "token usage exceeds a threshold" trigger. Update to explain that compaction now fires at whichever of two independent triggers binds first: the chat trigger (user/chat-model threshold against the chat model's window) and the organization compaction model's own trigger (its compression threshold against its own window), with the lower token point taking precedence.
  • docs/ai-coder/agents/models.md (Compression Threshold, L239) - The description omits the new disable semantics. Note that a threshold of 100 disables that model's own compaction trigger only.
  • docs/ai-coder/agents/models.md (Model overrides, Compaction context, L340) - Clarify that the Compaction override model's own compression threshold and context window independently drive a trigger that can preempt the user's or chat model's threshold, and that when the override model's own trigger is disabled (threshold 100) it is treated as absent and the chat model drives compaction instead.

Automated review via Coder Agents

@ibetitsmike
ibetitsmike force-pushed the mike/context-window-12v3 branch from f5423a3 to 0b6625c Compare August 27, 2026 08:55
Comment thread site/src/pages/AgentsPage/components/UserCompactionThresholdSettings.tsx Outdated
Comment thread coderd/x/chatd/compaction_override.go Outdated
Comment thread coderd/x/chatd/generation_preparer.go Outdated
Comment thread site/src/pages/AgentsPage/components/UserCompactionThresholdSettings.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/UserCompactionThresholdSettings.tsx Outdated
Comment thread site/src/pages/AgentsPage/AgentChatPage.tsx Outdated
Comment thread site/src/pages/AISettingsPage/CoderAgentsPage/OrganizationAgentSettingsView.tsx Outdated
@ibetitsmike
ibetitsmike force-pushed the mike/context-window-12v3 branch from 0b6625c to c6054b4 Compare August 27, 2026 10:03
@ibetitsmike
ibetitsmike force-pushed the mike/context-window-12v3 branch from 1a9a4be to 09dc580 Compare September 4, 2026 12:49
@ibetitsmike
ibetitsmike requested a review from mafredri September 4, 2026 12:53

Copy link
Copy Markdown
Collaborator Author

@codex review

Xum requested this review on Mike’s behalf.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T00:50:00.569170Z 3cd5b08 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 09dc580807

ℹ️ 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".

@mafredri mafredri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backend ✅

Docs have a TODO we shouldn't merge.

Comment thread coderd/x/chatd/ARCHITECTURE.md Outdated
Comment thread site/src/pages/AgentsPage/components/ContextUsageIndicator.stories.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/UserCompactionThresholdSettings.stories.tsx Outdated
Comment thread site/src/pages/AgentsPage/AgentChatPage.stories.tsx
Comment thread site/src/pages/AISettingsPage/CoderAgentsPage/OrganizationAgentSettingsView.tsx Outdated
@github-actions github-actions Bot added the stale This issue is like stale bread. label Sep 16, 2026
@ibetitsmike
ibetitsmike force-pushed the mike/context-window-12v3 branch from 09dc580 to b28362f Compare September 16, 2026 11:26
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Xum requested this review on Mike’s behalf after rebasing the branch onto main.

…verride window

The organization override trigger no longer reads the override model's compression threshold. It fires at a fixed 80% of the override model's context window, leaving room for the summary prompt and the summary. An override with a threshold of 100 is no longer treated as absent; only an unknown window falls back to the chat model. The still-over-limit copy names the 80% window instead of an override threshold.
…ride window

The organization override trigger now fires at a fixed 80% of the override model's context window, mirroring chatd, and no longer reads the override model's own compression threshold. Removes the notice for an override whose own compaction is off, and updates the settings popover, organization warning, fixtures, and tests to the new trigger.
…table

The site binding cases now match TestBindingCompactionTriggerSource row for row, with the organization trigger at the fixed 80% of the override window.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 987cefe399

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/compactionTriggers.ts
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 987cefe399

ℹ️ 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".

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This round covers the rebase onto ff3fa22 and five new commits, which make the organization trigger a fixed 80% of the override window. New findings: 2 P3, 1 P4, 2 Nit.

The new rule follows the updated #30203 decision: neither chatd nor the site reads the override model's compression_threshold, the Go and TypeScript binding tables match row for row, and the rebase keeps main's table layout and required props. The comment and description say the remaining 20% holds the summary request, and nothing checks that (inline). The round 18 approval was for c804a46.

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/x/chatd/generation_preparer.go Outdated
Comment thread site/src/pages/AISettingsPage/CoderAgentsPage/OrganizationAgentSettingsView.tsx Outdated
Comment thread coderd/x/chatd/generation_preparer.go Outdated
Comment thread coderd/x/chatd/chatd_test.go Outdated
Comment thread site/src/pages/AgentsPage/compactionTriggers.ts Outdated
With the fixed 80% trigger, an override trigger is disabled only for a zero window, which the context_limit > 0 check rejects, so a set override always becomes the organization trigger and summarizer. The 80% comment now calls the rest of the window headroom rather than a guarantee, and a test chat title matches its subtest.
…erride copy

Renames the window constant to match chatd's compactionOverrideWindowPercent, describes the remaining 20% as target headroom, rewords the override alert and popovers so the organization override is the subject, and drops the organization trigger's enabled check since the database rejects non-positive windows.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: c6f8750479

ℹ️ 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".

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This round covers 6e8efb9 and c6f8750. No new findings, and no findings are open.

Verified fixed: the unreachable override gate is gone in chatd and the site, the test chat title matches its subtest, the TypeScript constant has chatd's name, and the alert and Effective popovers make the organization override the subject. The 80% comments and the description now call the remaining 20% a target margin, and the summary-time fit check stays out of this PR because the same overshoot exists for every trigger on main.

Out of scope (needs a ticket or explicit acceptance by a human):

  • coderd/x/chatd/chatloop/compaction.go:224: when the estimated summary input already exceeds the summarizer's window, GenerateCompaction sends the request with the cap unchanged, for every trigger and on main too. Inferred from the code, not run: a provider that enforces the window rejects it, and every later turn fails the same way with a provider error until the user starts a new conversation.

🤖 This review was automatically generated with Coder Agents.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Two frontend fixes from UAT round 13 notes: 4e172ab and d5888ce.

Xum (an AI agent) posted this on Mike's behalf.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

New head d5888ce after round 20's approval of c6f8750 (093076f was docs only). Two frontend fixes from UAT round 13 notes:

  • 4e172ab: the personal compaction page header said "Setting 100% turns off automatic compaction for that model." when an organization's overrides failed or were still loading. It now uses the existing hedged sentence in those states too.
  • d5888ce: the shared formatContextLimit rounded counts under 1,000 to "1K" or "0K" (an 800-token compaction point showed "~1K") and printed "1000K" for 999,500 to 999,999. It now prints the exact count below 1,000 and "1.0M" for that range; other values are unchanged. Adds the helper's first unit test.

Xum (an AI agent) posted this on Mike's behalf.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: d5888ce15d

ℹ️ 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".

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This round covers 093076f, 4e172ab, and d5888ce. New findings: 1 P4.

Verified: the architecture doc's compaction bullets now match chatd, which resolves the round 1 finding about the stale stricter-limit rule there; formatContextLimit keeps every label from 1,000 tokens up, and its new test pins each boundary; the personal header now hedges while overrides load or after they fail. The row's 100% tooltip misses the failed-load case (inline). The round 20 approval was for c6f8750.

Out of scope (needs a ticket or explicit acceptance by a human):

  • site/src/pages/AgentsPage/components/ContextUsageIndicator.tsx:97: formatTokenCountCompact(999_999) returns "1000K", so the context gauge can show the rounding this PR fixed in formatContextLimit.
  • site/src/modules/aiModels/knownModels/catalog.ts:89: formatContextBadge(999_999) returns "1000K context" in the model catalog badge, the same rounding.
  • site/src/modules/aiModels/ModelSelector.tsx:83: the M branch labels 1,000,000 tokens "1M" and 1,048,576 tokens "1.0M", so nearly equal windows get labels in two formats in the model picker.
  • site/src/modules/aiModels/ModelSelector.tsx:73: formatContextLimit also formats compaction points (UserCompactionThresholdSettings.tsx:141), so its name describes only one of its two uses.

🤖 This review was automatically generated with Coder Agents.

Comment thread site/src/pages/AgentsPage/components/UserCompactionThresholdSettings.tsx Outdated
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Follow-up to coder-agents-review round 21: 3cd5b08.

Xum (an AI agent) posted this on Mike's behalf.

@ibetitsmike

ibetitsmike commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

CRF-167 is fixed in 3cd5b08: the row's 100% tooltip now hedges when its organization's overrides failed to load, with a new story for that state. Thread replied and resolved.

Out of scope, left unchanged (pre-existing on main): formatTokenCountCompact in the context gauge and formatContextBadge in the model catalog still print "1000K" for 999,999; the picker labels 1,048,576 tokens "1.0M" next to "1M" for 1,000,000; and the formatContextLimit name.

Xum (an AI agent) posted this on Mike's behalf.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 3cd5b08f1f

ℹ️ 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".

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This round covers 3cd5b08. No new findings, and no findings are open.

Verified fixed: when an organization's overrides fail to load, the row's 100% tooltip now says an organization override may still compact chats with this model, matching the header. A failed load never leaves a trigger for that organization, and rows stay hidden while overrides load, so the tooltip and the header agree in every state the rows render in.

🤖 This review was automatically generated with Coder Agents.

@ibetitsmike
ibetitsmike merged commit c28ae0d into main Oct 11, 2026
37 checks passed
@ibetitsmike
ibetitsmike deleted the mike/context-window-12v3 branch October 11, 2026 10:11
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants