[WRONG BRANCH] chore: sync metrics lane with current dev - #43
Conversation
Adds the internal compile-time plugin contract with bounded hook timeouts, request-scoped failure isolation, immutable structural payloads, class-instance hook support, and focused privacy/order tests. Validated by the full Linux, macOS, and Windows CI matrix including tests, privacy scan, GUI checks, and global package smokes.
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request currently targets Its title has been prefixed with OnlineChef Please retarget this PR to This pull request is being kept as a draft automatically. Once the target branch is corrected, it will be marked ready for review again. |
| } | ||
|
|
||
| /** Compile-time registration surface. It is intentionally empty by default. */ | ||
| export const pluginRegistry = new PluginRegistry(); |
There was a problem hiding this comment.
Plugin lifecycle is never invoked by production requests
The registry is exported here, but no production request handler imports it, creates a request session, or dispatches its hooks. A real streamed POST /v1/chat/completions request completed successfully after registering a global plugin, yet the plugin recorded no request, adapter-event, completion, or error callbacks. The feature is therefore inert outside the isolated unit tests. Wire session creation and dispatch into the shared request/adapter lifecycle, including event-stream wrapping and terminal completion/error handling.
Artifacts
Focused production lifecycle probe source
- This authored Bun probe registers a plugin, starts the real proxy and a local streaming adapter, then sends a real chat-completions request; it demonstrates the exact exercised path.
Production proxy request before plugin registration
- The before run starts the proxy and mock adapter and receives a complete 200 SSE response without a registered plugin, establishing the comparison baseline.
Production proxy request after plugin registration with no observed hooks
- The after run registers `production-probe`, receives the same complete 200 SSE response, and logs an empty `observedHooks` array, proving the registry is not connected.
Production registry reachability scan with no matches
- The production-only source scan exits with ripgrep status 1 and no matches for registry/session imports or lifecycle dispatch calls, confirming no static production integration.
Plugin registry unit test results
- The PR’s focused registry tests pass 10 of 10, showing the isolated API works while the production wiring remains absent.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/plugins/index.ts
Line: 460
Comment:
**Plugin lifecycle is never invoked by production requests**
The registry is exported here, but no production request handler imports it, creates a request session, or dispatches its hooks. A real streamed `POST /v1/chat/completions` request completed successfully after registering a global plugin, yet the plugin recorded no request, adapter-event, completion, or error callbacks. The feature is therefore inert outside the isolated unit tests. Wire session creation and dispatch into the shared request/adapter lifecycle, including event-stream wrapping and terminal completion/error handling.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Temporary branch-sync PR: merge the current
devtip, including merged plugin lane #40, intofeat/prometheus-metrics. The metrics files are disjoint from the plugin lane; this keeps PR #42 based on the actual integration head before final validation.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.Greptile Summary
This change adds a typed, privacy-preserving plugin registry with request-scoped sessions, immutable lifecycle payloads, hook timeouts, and failure isolation. Focused registry tests pass, but a real streamed
/v1/chat/completionsrequest never invokes a registered plugin because the production request path does not create or dispatch a plugin session.Merge safety: do not merge this as a functional plugin-lifecycle feature until production request handling wires the registry into adapter-request, event-stream, completion, and error paths.
Confidence Score: 4/5
Not safe to merge as an operational plugin lifecycle because real proxy requests bypass every plugin hook.
The central behavior added by this change was exercised against a real streamed proxy request and did not run despite a registered plugin. The isolated registry implementation and its focused tests behave correctly, but they do not establish integration with request processing.
Files Needing Attention: src/plugins/index.ts needs wiring from the shared production request and adapter lifecycle; the relevant production routing path begins in src/server/index.ts.
What T-Rex did
Comments Outside Diff (1)
General comment
/v1/chat/completionsrequest received zero hooks.src/plugins/index.tsadds an isolated registry/session API but no request lifecycle integration was added. The production chat route atsrc/server/index.ts:651-666invokeshandleChatCompletionsdirectly; production-wide reachability scan found no calls topluginRegistry,PluginRegistry,createSession,beforeAdapterRequest,observeAdapterEvents,onRequestComplete, oronRequestError.beforeAdapterRequestaround each outbound adapter attempt, wrap the actual adapter event iterable withobserveAdapterEvents, and invoke exactly one completion/error hook for every terminal outcome. Cover each supported request surface or explicitly narrow/document the supported surface.Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat(plugins): add typed observational l..." | Re-trigger Greptile