Skip to content

Comments

Address review feedback: IFileSystemService, log throttling, immutable prompt result#3961

Draft
Copilot wants to merge 2 commits intorosswollman/debug-prompt-override-filefrom
copilot/sub-pr-3959
Draft

Address review feedback: IFileSystemService, log throttling, immutable prompt result#3961
Copilot wants to merge 2 commits intorosswollman/debug-prompt-override-filefrom
copilot/sub-pr-3959

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

Addresses three review comments from #3959 on the promptOverrideFile debug setting.

Use IFileSystemService + URI instead of Node fs

  • applyPromptOverrides now accepts Uri + IFileSystemService instead of a raw string path with fs.promises.readFile
  • IFileSystemService injected into ToolCallingLoop and propagated through all 4 subclasses (McpToolCallingLoop, CodebaseToolCallingLoop, DefaultToolCallingLoop, SearchSubagentToolCallingLoop)
  • Tests use MockFileSystemService instead of vi.mock('fs')

Throttle warning logs for unreadable override files

  • First failure per file URI logs warn; repeated failures downgrade to trace
  • Successful read clears the state so subsequent errors re-surface as warn

Avoid mutating buildPromptResult

Replaced the type-cast mutation:

// Before
(buildPromptResult as { messages: Raw.ChatMessage[] }).messages = overrideResult.messages;

// After
const effectiveBuildPromptResult = { ...buildPromptResult, messages: overrideResult.messages };

All downstream consumers (token counting, _onDidBuildPrompt.fire, ResponseProcessorContext, fetch) now reference effectiveBuildPromptResult.

Tests

  • Migrated 7 existing tests from vi.mock('fs') to MockFileSystemService
  • Added 2 tests for log deduplication: repeated failures and re-warn after recovery

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…id mutating buildPromptResult

Co-authored-by: rwoll <11915034+rwoll@users.noreply.github.com>
Copilot AI changed the title [WIP] Allow static overrides of system prompts and tool descriptions Address review feedback: IFileSystemService, log throttling, immutable prompt result Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants