Skip to content

test: type-check agent hooks tool result offloading tests - #12720

Merged
anakin87 merged 1 commit into
deepset-ai:mainfrom
Anurag-M1:test/type-check-hooks-tool-result-offloading
Sep 14, 2026
Merged

anakin87 merged 1 commit into
deepset-ai:mainfrom
Anurag-M1:test/type-check-hooks-tool-result-offloading

Conversation

@Anurag-M1

Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes:

Enables mypy static typing checks on test/hooks/tool_result_offloading/:

  • Added test/hooks/tool_result_offloading/ to the types script line in pyproject.toml.
  • In test/hooks/tool_result_offloading/test_policies.py: added isinstance(restored, OffloadOverChars) assertion to narrow the restored policy before accessing .threshold.
  • In test/hooks/tool_result_offloading/test_hooks.py:
    • Updated TextOnlyToolResultStore.write parameter content to str | bytes to comply with the ToolResultStore protocol signature under Liskov substitution principles.
    • Added explicit typing annotations for content: list[TextContent | ImageContent | FileContent] in test cases.
    • Added # type: ignore[method-assign] and # type: ignore[attr-defined] for generator run/async mocking.

How did you test it?

  • hatch run test:types (All 508 source files passed mypy static typing check).
  • hatch run test:unit test/hooks/tool_result_offloading/ (All 40 unit tests in the module passed).
  • hatch run fmt-check (Format and ruff linting passed across all files).

Notes for the reviewer

This PR touches test files only and can be tagged with ignore-for-release-notes.
This PR was generated with an AI assistant. I have reviewed the changes and run all relevant tests locally.

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@Anurag-M1
Anurag-M1 requested a review from a team as a code owner September 12, 2026 17:02
@Anurag-M1
Anurag-M1 requested review from anakin87 and removed request for a team September 12, 2026 17:02
@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

@Anurag-M1 is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Sep 12, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@anakin87 anakin87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the conflict in pyproject.toml

@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

@Anurag-M1
Anurag-M1 force-pushed the test/type-check-hooks-tool-result-offloading branch from 38c2261 to 4ba0a5a Compare September 14, 2026 11:27
@Anurag-M1

Copy link
Copy Markdown
Contributor Author

@anakin87 Rebased onto upstream main and resolved the conflict in pyproject.toml. Type checks, unit tests, and formatting checks are all passing.

@anakin87 anakin87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@anakin87
anakin87 enabled auto-merge (squash) September 14, 2026 12:55
@anakin87
anakin87 merged commit 459f296 into deepset-ai:main Sep 14, 2026
30 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants