agentHost: fix customization watcher test session cleanup - #336973
Christof Marti (chrmarti) merged 5 commits into
Conversation
Assert changed instruction globs in scan and SDK discovery modes before adding another instruction. SDK discovery labels instructions by filename, so the previous name-only assertion passed before a watcher refresh. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused test-only changes correctly address the watcher race without weakening coverage or altering production behavior.
Review effort: Balanced
Findings: None
What changed in this PR
Stabilizes Copilot customization watcher integration tests by ensuring instruction edits produce observable state changes.
Changes:
- Uses concrete Markdown and TypeScript glob patterns.
- Verifies published rule globs before testing creation and deletion.
| File | Description |
|---|---|
copilotCustomizations.integrationTest.ts |
Makes instruction watcher assertions reliably detect edits. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Base:
|
Retain trace logs from failing customization tests to distinguish missing filesystem notifications from stale SDK discovery results. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure build 475418 confirms that the name-only assertion was hiding a missing refresh: with glob assertions, the test now times out on the edit itself. The initial test-only change is insufficient. Build 475420 adds retained watcher/discovery trace logs to investigate the underlying macOS failure. The local SDK dependency was also restored to the checkout version; focused tests still pass locally. |
CI diagnostics showed teardown disposing file:///undefined because it sent the obsolete session field. Use the current channel contract, type-check the request, and await the matching sessionRemoved notification before deleting the workspace. Remove temporary discovery tracing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the existing setup timeout for teardown so the disposal and removal-notification deadlines are not cut short by Mocha's five-second default hook timeout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Fix the macOS Electron customization watcher failure from Azure build 475402.
Retained diagnostics from build 475420 exposed the teardown bug: every
disposeSessionrequest sent the obsolete{ session }parameter. The protocol expects{ channel }, so the server was successfully disposingfile:///undefined, leaving the actual sessions and their discovery watchers alive while the test deleted their workspace folders. Subsequent tests accumulated stale discovery scans and overlapping watchers.DisposeSessionParams.root/sessionRemovednotification before deleting temporary workspaces so a success-shaped no-op cannot pass teardown again.applyToglobs. SDK discovery labels instructions by filename, so the old name-only assertion could pass without any refresh.**/*away.Temporary production trace instrumentation used during the investigation has been removed. The net change is confined to the customization integration test; no production behavior or skipped-test changes. Watcher timeouts are unchanged; teardown uses the existing setup timeout so its disposal assertions can finish.
Validation
npm run typecheck-clientpassed.