Skip to content

test(tools): add unit tests for clarify_tool.py - #121

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
Bartok9:test-clarify-tool
Feb 28, 2026
Merged

test(tools): add unit tests for clarify_tool.py#121
teknium1 merged 1 commit into
NousResearch:mainfrom
Bartok9:test-clarify-tool

Conversation

@Bartok9

@Bartok9 Bartok9 commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Add comprehensive test coverage for the clarify_tool module that handles interactive clarifying questions.

Changes

  • Add tests/tools/test_clarify_tool.py with 20 unit tests

Test Coverage

TestClarifyToolBasics (5 tests)

  • Simple question with callback
  • Question with choices
  • Empty question returns error
  • Whitespace-only question returns error
  • No callback returns error

TestClarifyToolChoicesValidation (5 tests)

  • Choices trimmed to MAX_CHOICES (4)
  • Empty choices list becomes None
  • Whitespace-only choices stripped
  • Invalid choices type returns error
  • Non-string choices converted to strings

TestClarifyToolCallbackHandling (3 tests)

  • Callback exception returns error
  • Callback receives stripped question
  • User response is stripped

TestCheckClarifyRequirements (1 test)

  • Always returns True (no external deps)

TestClarifySchema (6 tests)

  • Schema name is 'clarify'
  • Schema has description
  • Question is required
  • Choices is optional
  • Choices has maxItems constraint
  • MAX_CHOICES constant is 4

Testing

uv run pytest tests/tools/test_clarify_tool.py -v
# 20 passed

Add comprehensive test coverage for the clarify_tool module:

- TestClarifyToolBasics: 5 tests for core functionality
  - Simple questions, questions with choices, error handling

- TestClarifyToolChoicesValidation: 5 tests for choices parameter
  - MAX_CHOICES enforcement, empty/whitespace handling, type conversion

- TestClarifyToolCallbackHandling: 3 tests for callback behavior
  - Exception handling, question/response trimming

- TestCheckClarifyRequirements: 1 test verifying always-true behavior

- TestClarifySchema: 6 tests verifying OpenAI function schema
  - Required/optional parameters, maxItems constraint

Total: 20 tests covering all public functions and edge cases.
@teknium1
teknium1 merged commit 0d2ac1c into NousResearch:main Feb 28, 2026
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
test(tools): add unit tests for clarify_tool.py
gizdusum pushed a commit to gizdusum/hermes-agent that referenced this pull request May 17, 2026
test(tools): add unit tests for clarify_tool.py
@shang-vikas

Copy link
Copy Markdown

Deployment Verification Report

Hooks Installed

Hook File Status Lines Added
#116 — Prompt footer agent/conversation_loop.py ✅ INSTALLED +14
#117 — Skill load observer tools/skills_tool.py ✅ INSTALLED +9
#118 — Session finalizer hermes_state.py ✅ INSTALLED +8

Bundle

Check Status
Bundle validated (14 files) ✅ PASS
Model loads + inference works ✅ PASS
Symlink in venv site-packages ✅ CONFIRMED

Cron Jobs

Job Schedule Status
p8-session-finalizer Every 5 min ✅ ACTIVE
p8-stage1-monitor Every 10 min ✅ ACTIVE

Environment

Variable Value
P7_HOOKS_MODE off (set in .zshrc + .bashrc)

End-to-End Test

Test Result
build_skill_footer(mode=off) → empty string ✅ PASS
build_skill_footer(mode=hybrid) → 5 suggestions ✅ PASS (286 chars)
observe_skill_load() → telemetry written ✅ PASS
finalize_session() → outcome written ✅ PASS
Health counters incrementing ✅ PASS

Next

Stage 1 (invisible) is live. Monitor reports here every 10 min. After 100 sessions, switch to Stage 2 (10% visible footer).

waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
test(tools): add unit tests for clarify_tool.py
Meraniya pushed a commit to Meraniya/hermes-agent that referenced this pull request Aug 6, 2026
* fix: add --legacy-peer-deps to TUI npm install

eslint-plugin-react@7 does not declare peer support for eslint@10,
causing ERESOLVE errors when hermes dashboard --tui runs npm install
in ui-tui/ on a fresh checkout. Adding --legacy-peer-deps allows the
install to proceed since the conflict is dev-only (linting tools).

Co-Authored-By: Oz <oz-agent@warp.dev>

* fix: enforce privileged cron model policy

---------

Co-authored-by: Oz <oz-agent@warp.dev>
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