Skip to content

feat: prompt pre fetch plugin call#81

Draft
julianstephen wants to merge 1 commit intokagenti:mainfrom
julianstephen:js-prompt-hooks
Draft

feat: prompt pre fetch plugin call#81
julianstephen wants to merge 1 commit intokagenti:mainfrom
julianstephen:js-prompt-hooks

Conversation

@julianstephen
Copy link
Copy Markdown
Collaborator

@julianstephen julianstephen commented Mar 27, 2026

Summary

Fixes for #56

Related issue(s)

(Optional) Testing Instructions

Create a new envoy filter that will route to ext proc on prompt gets

Signed-off-by: julianstephen <julian.stephen@gmail.com>
Copy link
Copy Markdown
Contributor

@rubambiza rubambiza left a comment

Choose a reason for hiding this comment

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

Thanks for adding prompt pre-fetch support — the overall structure looks good. A few things to address before this can merge:

CI is red — build fails on both Python 3.11 and 3.12. Please investigate and fix.

assert payload.args is not None (plugin.py ~line 90) — assert statements are stripped in optimized mode (python -O) and will crash the process otherwise. This should be a proper check that returns a PromptPrehookResult with a violation, similar to the error handling below it.

Unreachable code — the original return PromptPrehookResult(continue_processing=True) at the end of prompt_pre_fetch is now dead code after the new implementation. Can be removed.

Minor:

  • f-string f"... payload {payload}" in the debug log could dump large objects. Consider logging just payload.prompt_id or similar.
  • Missing newline at end of tests/single-server-filter.yaml.

@rubambiza
Copy link
Copy Markdown
Contributor

@julianstephen Since this is still in draft, feel free to ignore my comments for now 😅 I should have specified to Claude to surface PRs that are ready for reviews.

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.

🐛 prompt pre fetch and prompt post fetch has not been tested

2 participants