Skip to content

TEST: Assert capability probe outcomes - #3279

Merged
Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
richlundeen:richlundeen-probe-cancellation-reliability
Oct 18, 2026
Merged

Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
richlundeen:richlundeen-probe-cancellation-reliability

Conversation

@richlundeen

@richlundeen Richard Lundeen (richlundeen) commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Merged current main (345df8fd0233467273d86fd89dbecea8ff02b274) and kept only the additional capability-result assertions now that #3268 has merged.

#3268 already fixed the original capability-probe test timing issue. This PR preserves its shared TEST_WATCHDOG_SECONDS, request-entry synchronization, real timeout cancellation, and owned-task cleanup unchanged.

The remaining one-file change makes test_responses_probes_suppress_provider_io_and_preserve_state check the returned TargetCapabilities, rather than discarding it:

  • Successful requests must report supports_json_output=True.
  • Errors and timeouts must report supports_json_output=False.

These assertions run across all four combinations of initialized tool state and cached target identity. Existing cancellation propagation, provider-I/O suppression, tool state, configuration, and identity assertions remain intact.

This is additional result coverage, not another fix for the timing issue already addressed by #3268. No production behavior, deadlines, dependencies, or public APIs change.

Tests and Documentation

Validation of the merged, narrowed change on Windows with Python 3.14.4, using this worktree's uv environment with the litellm extra:

  • uv run --no-sync python -m pytest -q -p no:cacheprovider --tb=short tests\unit\prompt_target\test_discover_target_capabilities.py: 92 passed. Includes all 16 provider-state variants and the real short-deadline retry test.
  • uv run --no-sync ruff check --no-cache tests\unit\prompt_target\test_discover_target_capabilities.py: passed.
  • uv run --no-sync ruff format --check --no-cache tests\unit\prompt_target\test_discover_target_capabilities.py: passed, file already formatted.
  • uv run --no-sync ty check --output-format concise tests\unit\prompt_target\test_discover_target_capabilities.py: passed.
  • git diff --cached --check: passed before committing.

LITELLM_LOCAL_MODEL_COST_MAP=True was set for the local test process. Tests use isolated SQLite and mocked provider boundaries, with no live providers or credentials.

No documentation or notebooks changed, so JupyText is not applicable. The full unit suite, all-extras environment, and macOS execution were not run for this update. Earlier CI results do not validate this new merge.

Wait for the mocked request before expiring the timeout case, keep a finite correctness watchdog for other outcomes, and verify timeout cancellation and capability results.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f6823ad6-881a-4bbe-bf55-7b4ccc04a13a
Preserve the watchdog, request-entry synchronization and task cleanup merged in microsoft#3268. Keep only the returned JSON capability assertions as the remaining delta.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e52c81e0-1386-4099-9cfc-b52c7632320f
@romanlutz Roman Lutz (romanlutz) changed the title TEST: Make capability probe cancellation checks reliable TEST: Assert capability probe outcomes Oct 17, 2026
@ManoharPaturi

Copy link
Copy Markdown
Contributor

Asserting the returned TargetCapabilities instance directly closes an important verification gap in these discovery tests. Previously the test verified that the underlying client call was attempted and cancelled on timeout, but never asserted that the returned capability flags actually reflected the failure or success state. Returning the capabilities object from probe_async and asserting supports_json_output ensures the probe outcome contract is explicitly validated.

@romanlutz

Copy link
Copy Markdown
Contributor

I merged in the latest changes in main which reduced this changeset considerably. Updated title and description accordingly

@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 18, 2026
Merged via the queue into microsoft:main with commit 7534bda Oct 18, 2026
60 checks passed
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.

3 participants