Skip to content

test: add unit tests for 5 security/logic-critical modules (batch 4) - #193

Merged
teknium1 merged 2 commits into
NousResearch:mainfrom
0xbyt4:test/expand-coverage-4
Mar 5, 2026
Merged

test: add unit tests for 5 security/logic-critical modules (batch 4)#193
teknium1 merged 2 commits into
NousResearch:mainfrom
0xbyt4:test/expand-coverage-4

Conversation

@0xbyt4

@0xbyt4 0xbyt4 commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • gateway/pairing.py (28 tests): Rate limiting, lockout after failed attempts, code expiry, approval flow, revoke, file permissions
  • tools/skill_manager_tool.py (46 tests): Name/frontmatter/path validation, path traversal prevention, CRUD operations with rollback
  • tools/skills_tool.py (34 tests): YAML frontmatter parsing with fallback, tag parsing (list/bracket/comma formats), skill discovery, category filtering, skill_view resolution chain
  • agent/auxiliary_client.py (16 tests): Nous auth.json reading with edge cases, API key resolution priority, max_tokens param branching per provider
  • honcho_integration/session.py (20 tests): HonchoSession dataclass (add/get/clear), ID sanitization, migration transcript formatting

144 new tests, zero source code changes.

- gateway/pairing.py: rate limiting, lockout, code expiry, approval flow (28 tests)
- tools/skill_manager_tool.py: validation, path traversal prevention, CRUD (46 tests)
- tools/skills_tool.py: frontmatter/tag parsing, skill discovery, view chain (34 tests)
- agent/auxiliary_client.py: auth reading, API key resolution, param branching (16 tests)
- honcho_integration/session.py: session dataclass, ID sanitization, transcript format (20 tests)
# Conflicts:
#	tests/agent/test_auxiliary_client.py
@teknium1
teknium1 merged commit b336980 into NousResearch:main Mar 5, 2026
@teknium1

teknium1 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Merged in commit b336980. All 128 new tests pass, full suite at 1480. Thanks for the thorough coverage on security-critical modules! 🙏

Note: the PR description mentions 16 auxiliary_client.py tests but they don't appear in the diff — might have been accidentally left out of the branch. No blocker, the 128 tests that are here are solid.

angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…al modules (batch 4)

Authored by 0xbyt4.

144 new tests covering gateway/pairing.py, tools/skill_manager_tool.py,
tools/skills_tool.py, honcho_integration/session.py, and
agent/auxiliary_client.py.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…al modules (batch 4)

Authored by 0xbyt4.

144 new tests covering gateway/pairing.py, tools/skill_manager_tool.py,
tools/skills_tool.py, honcho_integration/session.py, and
agent/auxiliary_client.py.
nicezic pushed a commit to nicezic/hermes-agent that referenced this pull request Aug 26, 2026
run_conversation() only injects /steer into a *following* tool result. A steer
that lands after the final tool batch — or during a text-only turn — comes back
as result["pending_steer"] for the caller to re-deliver. cli.py consumes it, but
the tui_gateway turn-runner (every desktop/TUI/Dashboard chat) never read it, so
the leftover steer was silently dropped.

This is acute on the desktop, whose default busy-input mode is "steer": users
reported (NousResearch#193) that a steer sent mid-task "等到任务执行完也没插入进去".

Fix mirrors the existing goal_followup chain: capture result["pending_steer"]
and, after the finally releases session["running"], fire a nested
_run_prompt_submit with the steered text. Guarded by the running flag so a racing
real prompt wins; runs before goal continuation since it's explicit user input.
No extra message.start (the nested call emits its own).

Tests: tests/tui_gateway/test_pending_steer_followup.py.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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