You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b28362f
Browse filesBrowse the repository at this point in the historyBrowse files
feat: trigger compaction independently per chat and compaction model
Compaction fires at whichever of two independent triggers is reached
first: the chat trigger (user or chat model threshold against the chat
model's window) and the organization compaction override model's own
trigger (its compression threshold against its own window). The enabled
trigger with the lower token point binds and flows through the existing
compaction plumbing. A threshold of 100 disables only its own trigger.
The UI mirrors the backend rules from the existing member-readable
model-overrides and models endpoints: the org settings compaction row
warns when the selected model's trigger undercuts chat models' default
trigger points, the user thresholds page shows the effective trigger in
its own column with an organization-override popover, and the chat
context gauge annotates the compact-at percent when the organization
trigger binds.
Copy file name to clipboardExpand all lines: coderd/x/chatd/ARCHITECTURE.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -964,6 +964,8 @@ The model editor scopes the field to openai-typed providers with a `providers` s
964
964
965
965
#### Compaction model selection
966
966
967
+
TODO: Document independent chat and override compaction triggers and the shared post-compaction limit check.
968
+
967
969
Compaction is an auxiliary LLM call: when the conversation approaches the context limit, the generation goroutine asks a model to summarize the history, commits the summary as a compressed boundary, and continues the turn on the chat model.
968
970
969
971
By default the summary is generated with the chat model. Organization admins can select a dedicated compaction model via `PUT /api/v2/organizations/{organization}/chats/model-overrides/compaction`. The selection is stored as a typed `chat_organization_model_overrides` row and resolved using the chat's organization. Its composite foreign key binds the model config UUID to that organization, so cross-organization and malformed string references cannot be stored. The override affects only the summary call; compressed-message storage and the post-compaction assistant generation keep using the chat model.
0 commit comments