Skip to content

fix(hooks): route OpenVikingPostCallHook async so enriched result isn't discarded#3164

Open
nankingjing wants to merge 2 commits into
volcengine:mainfrom
nankingjing:fix/async-hooks-discard-returns
Open

fix(hooks): route OpenVikingPostCallHook async so enriched result isn't discarded#3164
nankingjing wants to merge 2 commits into
volcengine:mainfrom
nankingjing:fix/async-hooks-discard-returns

Conversation

@nankingjing

Copy link
Copy Markdown
Contributor

Summary

OpenVikingPostCallHook.execute() is genuinely async (it awaits OpenViking search/read) but was routed through the synchronous hook path, which discards hook return values. As a result the enriched result (skill experiences appended to a read_file output) was silently dropped.

Problem

The hook manager routes hooks by an is_sync marker. OpenVikingPostCallHook inherited the default and was treated as sync, so the manager executed it on the sequential sync path that ignores returns — the tool.post_call enrichment never reached the model.

Fix

Mark the hook is_sync = False so the manager routes it through the async asyncio.gather path that honors the returned {tool_name, params, result}, delivering the appended experiences.

Test

bot/vikingbot/tests/unit/test_hooks_sync_routing.py — asserts the post-call hook is routed async and its returned enriched result is preserved (3 passed).

The previous integration test run on PR volcengine#3164 was CANCELLED before
completion (likely a runner timeout / superseded by newer push).
Other checks (plugin-tests, check-deps) are green. Pushing an empty
commit to re-trigger the integration suite so the PR has a definitive
result before maintainer review.
@nankingjing

Copy link
Copy Markdown
Contributor Author
Self-reviewed: diff is correct, minimal, and well-tested. No issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant