Skip to content

feat(viking): tool filtering, error diagnostics, and URI-prefix instructions - #381

Merged
Million-mo merged 1 commit into
wolf1069b:mainfrom
Million-mo:feat/viking-tool-improvements
Aug 19, 2026
Merged

feat(viking): tool filtering, error diagnostics, and URI-prefix instructions#381
Million-mo merged 1 commit into
wolf1069b:mainfrom
Million-mo:feat/viking-tool-improvements

Conversation

@Million-mo

Copy link
Copy Markdown
Collaborator

Summary

Improves the Viking knowledge-graph capability in four ways:

1. Multi-prefix search (bug fix)

viking_search/viking_find now accept a list of target_uri prefixes. When
target_uri is omitted and an allowlist is configured, both tools pass every
allowed prefix to the SDK — previously they scoped to only the first allowed
prefix, silently dropping results from the other allowed trees.

2. Dynamic URI-prefix instructions

get_instructions() renders an Allowed URI Prefixes section when
allowed_uri_prefixes is configured, so the model sees the scoping boundary
up front and can pass the most specific target_uri directly, skipping
discovery probing (viking_ls) and the slower whole-allowlist search.

3. Diagnosable error returns

All 15 viking_* tools now include the exception type in error returns:
viking_search error (ReadTimeout): .... Empty-message failures like
httpx.ReadTimeout('') (slow semantic search on large resource trees) previously
rendered as a useless viking_search error: with no clue what went wrong.

4. Tool filtering

VikingCapabilityConfig gains enabled_tools / disabled_tools
(mutually exclusive, mirroring StdioMCPServerConfig). Operators can disable slow
semantic-search tools while keeping the deterministic ones:

capabilities:
  - type: viking
    mode: retrieve
    disabled_tools: ["viking_search", "viking_find"]

The filter applies in build_tools() after mode-based assembly and propagates
to both the toolset and the OpenCode /experimental/tool listing.

Tests

  • 498 passed, 1 skipped in tests/capabilities/viking/
  • New tests: multi-prefix defaults, enabled/disabled tool filtering, mutual-exclusivity
    validation, empty-message error diagnostics
  • ruff check and mypy clean on changed source

Changelog

  • 2026-08-18-viking-allowed-uri-prefixes.md (extended: search scoping behavior)
  • 2026-08-19-viking-tool-error-diagnostics.md (new)
  • 2026-08-19-viking-tool-filtering.md (new)

…uctions

- viking_search/find accept multiple target_uri prefixes and default to the
  full allowed_uri_prefixes allowlist (previously only searched the first)
- get_instructions() renders a dynamic Allowed URI Prefixes block so the
  model passes target_uri directly and skips discovery probing
- all 15 viking_* tools include the exception type in error returns so
  empty-message failures like ReadTimeout('') remain diagnosable
- VikingCapabilityConfig gains enabled_tools/disabled_tools whitelist/
  blacklist filtering (mutually exclusive) to disable slow semantic-search
  tools
@Million-mo
Million-mo force-pushed the feat/viking-tool-improvements branch from 72f6c99 to 5e38fa2 Compare August 19, 2026 08:59
@Million-mo
Million-mo merged commit 1ad4d1b into wolf1069b:main Aug 19, 2026
12 checks passed
@Million-mo
Million-mo deleted the feat/viking-tool-improvements branch August 19, 2026 09:11
Million-mo added a commit to Million-mo/agentpool that referenced this pull request Aug 19, 2026
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.

1 participant