Append a stable transcript-file hint (path + line-count snapshot) to
every conversation summary, so after compaction the model can read
the uncompacted transcript on disk.
The hint is appended exactly once at summary-creation time and stored
on round.summary / turn metadata. Subsequent renders replay that
string byte-identically, preserving Anthropic prompt cache hits even
as the transcript keeps growing.
Covers all three summarization paths:
- Full / Simple via ConversationHistorySummarizer.summarizeHistory()
- Inline background via agentIntent.ts _startBackgroundSummarization
(flushes the transcript before snapshotting the line count so the
baked count matches the on-disk file)
Shared via new exported helper appendTranscriptHintToSummary.
* Fix enterprise BYOK issues: hidden models, disabled button, account carryover
Fix three bugs in the BYOK (Bring Your Own Key) model feature:
1. #309499 - BYOK models hidden by default: Add isUserSelectable: true
to byokKnownModelToAPIInfo() so models appear in the picker on
registration instead of defaulting to hidden.
2. #309492 - Add Models button disabled when BYOK enabled: Call
_updateClientByokEnabledContext() during ContextKeysContribution
initialization so the clientByokEnabled context key is set before
the Language Models view renders.
3. #309501 - BYOK model carries over from individual account: Use a
separate DisposableStore for BYOK provider registrations and clear
them when switching to an account with BYOK disabled, resetting
the registration flag to allow re-registration on next auth change.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix Language Models UI not refreshing on group add/remove (#309495)
The Language Models view did not auto-update when:
- Adding a BYOK model with an invalid configuration (error status)
- Removing a BYOK model group
Root cause: _resolveAllLanguageModels only checked model cache changes
to decide whether to fire onDidChangeLanguageModels. When groups were
added/removed but the model set didn't change (e.g., groups with errors
or empty groups), the event never fired and the UI stayed stale.
Fixes:
1. Add _hasGroupStructureChanged to detect group-level changes (count,
names, statuses) independently of model cache changes
2. Add explicit viewModel.refresh() after delete action, matching the
pattern already used by the managementCommand path
3. Await configureLanguageModelsProviderGroup in addModelsForVendor and
refresh the view model after the add flow completes
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The CLI runtime emits `github.copilot.time_to_first_chunk` (seconds) on
chat spans, while the foreground extension uses
`copilot_chat.time_to_first_token` (ms). The SQLite store only checked
the foreground attribute, leaving ttft_ms NULL for CLI background agent
spans.
Add a `_ttftMs()` helper that coalesces both attributes with unit
conversion (seconds → ms) so the denormalized column is always populated.
* Update hidden Model B agent prompt for evals
* Refine hidden Model B prompt tag structure
* updating prompt to remove codex string
* main merge
* adding task execution tag
* adding task execution tag
* updating labels
Previously both cache hits and reused in-flight requests (async pending
or speculative) showed the database icon in the NES debug log. This
made it hard to tell whether a result was served from cache or joined
an existing stream.
Add a new \`reusedInFlight\` outcome with a git-merge icon ($(git-merge))
to visually distinguish 'joined an in-flight request' from 'loaded from
cache'. The database icon is preserved for true cache hits via
\`setIsCachedResult\`; reused in-flight requests now go through the new
\`setIsReusedInFlightResult\` method.
* Move to InputState instead of metadata on sessions
Cleans up more old patterns with new patterns.
Co-authored-by: Copilot <copilot@github.com>
* feedback
Co-authored-by: Copilot <copilot@github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Adds a pure helper shouldKickOffBackgroundSummarization that gates the
post-render background compaction trigger based on prompt-cache warmth:
- inline + warm cache (toolCallRounds.length > 0): jittered threshold in
[0.78, 0.82) straddling the historical 0.80 edge.
- inline + cold cache: emergency kick-off at >= 0.90 to keep long-running
sessions from hitting sync foreground compaction.
- non-inline: unchanged >= 0.80.
The rng is injected via a private field so tests are deterministic and
the warm-only jitter path is exercised without touching Math.random.
* Adopt InputState in Claude
Gets rid of the old options API
Co-authored-by: Copilot <copilot@github.com>
* agents.md
* Address PR review comments
- Fix _rebuildInputState to branch on existing vs new sessions,
preserving locked groups for existing sessions
- Fix permissionModes type from ReadonlySet<string> to ReadonlySet<PermissionMode>
- Fix disposable leak: track onDidChange subscriptions alongside WeakRefs,
sweep on refresh, and dispose all on provider teardown
- Avoid strong state capture in onDidChange closure (use WeakRef deref)
---------
Co-authored-by: Copilot <copilot@github.com>
* feat(copilotcli): Support CLI todo via worker support
* Fix tests
Co-authored-by: Copilot <copilot@github.com>
* Address Copilot review comments
- Swap logService.error arguments (error first, context second)
- Update todo widget even when query returns empty list
- Use separator-agnostic regex in test assertion
- Change RpcProxy to import type
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: guard against missing DB file and set busy_timeout
- Add existsSync check before opening DatabaseSync to prevent
creating phantom empty database files
- Set PRAGMA busy_timeout = 2000 to reduce SQLITE_BUSY errors
during concurrent CLI writes
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Callers can now opt into Anthropic features (context editing, tool
search, etc.) by setting modelCapabilities on the request itself,
as introduced in #308387. The base endpoint no longer needs to inject
beta headers — the Claude agent controls its own headers.
Reverts the merge logic from microsoft/vscode-copilot-chat#4945.
Simplify compaction fallback: use Simple mode on budget exceeded, skip Full
When the main prompt render exceeds the token budget and falls back to
foreground summarization (renderWithSummarization), skip Full mode and
go straight to Simple mode via forceSimpleSummary. This saves a wasted
LLM request since Full would likely also fail under the same budget
pressure, and Simple is guaranteed to fit via hard tool-result truncation.
- Add forceSimpleSummary prop to AgentPromptProps and SummarizedAgentHistoryProps
- Honor forceSimpleSummary in getSummaryWithFallback (unless config forces Full)
- Remove summarizationSource prop and source telemetry field (no longer needed)
- Clean up stale GDPR annotations for removed source field
- /compact and background standard-mode paths keep existing Full → Simple chain
- Use single for-loop to partition available_models into routableModels and
droppedModels (bhavyaus review)
- Fix test: when ALL available_models are unknown, _selectDefaultModel throws
since none match knownEndpoints — test now expects throw instead of gpt-4o
Previously isNESForAnotherDoc was only set inside addNotebookTelemetry,
so non-notebook cross-file NES always reported false.
- Set the flag on the main edit path for all cases (notebook and non-notebook)
- Set the flag on the jump-to-position path when targetDocumentId differs
- Set the flag and status 'noEdit:crossFileTargetNotFound' when cross-file
target document is not found in the workspace
- Remove redundant setIsNESForOtherEditor call from addNotebookTelemetry
Emits a new telemetry event after all client-side model overrides are applied.
Properties: candidateModel, actualModel, overrideReason (none/clientOverride),
conversationId. Tests cover: match, vision fallback override, router failure.
Bug fixes only (no telemetry changes):
1. Filter available_models through knownEndpoints before sending to router
2. Remove same-provider override from router path - trust router ranking
3. Iterate all candidate_models via _findFirstAvailableModel
4. Warn-level logs for sync mismatches
* nes: cache: add a test to show how rebasing fails
* feat: add reverse-agreement rebase for NES cache behind experiment flag
When the user types more text than the model predicted at the same
position (e.g., model: '{', user: '{\n\t'), the rebase engine now
recognizes that the model's edit is consumed by the user's typing and
offers the remaining unconsumed model edits as rebased suggestions.
The new behavior is gated behind the 'reverseAgreement' experiment
flag in NesRebaseConfigs (config key:
chat.advanced.inlineEdits.reverseAgreement, default: false).
Adds 10 unit tests covering positive, negative, and edge cases.
* better handling of too many images in chat
* address review: handle no-user-message fallback, assert filter output, cover tool-role images
* factor filterHistoryImages into a pure helper with direct tests
* restore validateAndFilterImages delegate so existing tests are unchanged
* address comments, throw early
* chronicle
* local and cloud store
* upload vscode events to remote store
* few updates
* consent ui and settings
* few optimizations
* test fix
* feedback updates
* test fix
* check setting to enable cmd
* fix test
* Settings update and tool update
* command update
* Settings update
* merge main
* feedback updates
* setting and test update
* few updates
* updates
* test update
* blocks ci update
* feedback updates
* comment update
Consolidate reasoning effort override into single advanced setting
Replaces chat.advanced.responsesApiReasoningEffort and chat.advanced.anthropicThinkingEffort with a single chat.advanced.reasoningEffortOverride setting used by both the Responses API and the Anthropic Messages API for evals.
Follow-up to #310343: remove dead code left behind after server-side
tool search removal.
- Remove IServerToolCall interface from fetch.ts
- Remove serverToolCalls field from IResponseDelta
- Remove logServerToolCall from IRequestLogger interface and all implementations
- Remove dead consumer in toolCallingLoop.ts
- Clean up unused imports
- Remove all server-side tool_search_tool_regex types, handlers, and stream processing from messagesApi.ts
- Remove isAnthropicToolSearchEnabled/isAnthropicCustomToolSearchEnabled functions
- Remove AnthropicToolSearchEnabled and AnthropicToolSearchMode settings
- Remove TOOL_SEARCH_TOOL_NAME, TOOL_SEARCH_TOOL_TYPE, TOOL_SEARCH_SUPPORTED_MODELS constants
- Refactor modelSupportsToolSearch to use version parsing instead of prefix list
- Add models filter to ToolSearchTool registration for Claude Sonnet/Opus 4.5+
- Fix MockEndpoint to derive supportsToolSearch from model family
- Gate advanced-tool-use beta header directly on endpoint.supportsToolSearch
- Update prompts to use client-side tool_search name and semantic search instructions
- Update 24 snapshot files to reflect new tool name and instructions