400 Commits

Author SHA1 Message Date
Luis Pater
249ea68d71 fix(gemini): emit Google RPC APIError JSON for post-commit SSE stream errors
- Replace OpenAI-formatted event: error frames in GeminiAPIHandler.forwardGeminiStream with single-line Google RPC error JSON payloads carrying integer code, message, and status fields for google.golang.org/genai compatibility.
- Preserve existing upstream Google RPC error details when present and normalize plain-text or non-Gemini JSON error payloads into valid Google RPC error objects.
- Update pre-first-token keep-alive failure assertions and add regression tests covering post-commit SSE errors and post-thought Antigravity MALFORMED_FUNCTION_CALL termination.

Closes: #8547
2026-11-27 22:06:22 +08:00
Luis Pater
0aaf6d1c3a Merge pull request #8515 from router-for-me/acp
feat(home): add local plugin executor dispatch
2026-11-26 20:00:35 +08:00
hkfires
6acc778c0f feat(home): add local plugin executor dispatch
Authorize acp/ models via Home local-plugin-dispatch and run
the selected plugin executor without upstream credentials.
Validate plugin version, config digest, host/Home fences, and
the authorized model across execute, stream, and count paths,
while falling back to credential dispatch for legacy Home.

Preserve before-auth interception, usage attribution, payload
finalization, and router exclusions for delegated requests.
Expose static executor models and avoid reusing resident
shadow plugin images on reload.
2026-11-26 19:16:36 +08:00
Luis Pater
d3ec7abe48 fix(openai): preserve data URLs and repeated form fields for video reference_image_urls
- Read all values from both `reference_image_urls` and `reference_image_urls[]` form keys via `PostFormArray` in `videosCreateRequestFromForm`.
- Parse JSON-encoded reference arrays and split comma-separated values only at URL boundaries so RFC 2397 `data:` URLs and URLs with embedded or consecutive commas remain intact.
- Add multipart and form-urlencoded regression tests verifying both parsed form payloads and upstream xAI `reference_images` mapping.

Closes: #8218
2026-11-26 11:59:39 +08:00
Luis Pater
9b1484c767 fix(openai): handle ojson null fields and array prompts in legacy completions converter
- Extract string elements from array prompts and guard optional request parameters in convertCompletionsRequestToChatCompletions against JSON null while preserving legacy integer logprobs compatibility.
- Emit JSON null for empty or null finish_reason and require usage.IsObject() in both streaming and non-streaming /v1/completions response converters so usage: null does not bypass empty-chunk filtering.
- Add regression unit tests for /v1/completions request/response conversion and tighten the legacy truncated-stream test assertion to check SSE error.message.

Closes: #8216
2026-11-26 11:45:54 +08:00
Luis Pater
721d22dd64 fix(gemini): split action on last colon to support model IDs containing colons
- Parse POST /v1beta/models/*action using strings.LastIndex so model IDs and aliases containing colons route cleanly to generateContent, streamGenerateContent, and countTokens.
- Reject missing colons, empty model names, and empty methods with HTTP 404 while preserving the existing unsupported-method 404 response.
- Add regression tests covering single/multiple-colon model IDs and invalid action path edge cases.

Closes: #8217
2026-11-26 11:41:42 +08:00
Luis Pater
7fa46e9d86 fix(antigravity): commit reasoning replay cache on clean-EOF streams without finishReason
- Track observed candidate output on antigravityReasoningReplayAccumulator and add MarkCleanEOF to mark clean-EOF completions terminal while rejecting empty candidates and incomplete streaming tool calls.
- Add SSEJSONAssembler.HasPending and gate clean-EOF replay commits in ExecuteStream and executeClaudeNonStream on clean context and complete SSE framing.
- Add regression tests covering clean-EOF tool streams, non-stream SSE aggregation, empty candidate cache preservation, and truncated trailing SSE frames.

Closes: #8172
2026-11-26 08:31:54 +08:00
Luis Pater
173baf1de4 fix(gemini): emit empty SSE frames for keep-alive heartbeats
- Replace ": keep-alive\n\n" SSE comment heartbeats with empty SSE frames ("\n\n") across Gemini streamGenerateContent and Interactions streaming endpoints to stay compatible with google.golang.org/genai.
- Override StreamForwardOptions.WriteKeepAlive in forwardGeminiStream and forwardInteractionsStream so mid-stream pauses and continuity waits emit empty SSE frames without affecting other protocols.
- Update Gemini pre-first-token keep-alive assertions and add regression tests covering pre-first-token and mid-stream SSE keep-alive frames.

Closes: #8164
2026-11-26 07:23:19 +08:00
Luis Pater
096f77932f fix(gemini): prevent goroutine leak on client disconnect in interactions stream
- Extract the interactions stream chunk forwarder into forwardInteractionsChunks and guard chunk reads and channel sends with done and cliCtx.Done() cancellation signals.
- Add deterministic unit and HTTP disconnect regression tests verifying the forwarding goroutine closes its output channels and exits cleanly on cancellation.

Closes: #8141
2026-11-26 01:38:23 +08:00
Luis Pater
0855f63050 fix(gemini): return 404 error response for unsupported :method actions
- Add a default branch to the method switch in GeminiHandler to return HTTP 404 with a structured invalid_request_error JSON payload instead of an empty 200 OK.
- Reject empty :method suffixes in the action path as 404 not found and add regression tests covering unsupported, misspelled, and empty methods.

Closes: #8140
2026-11-26 01:31:29 +08:00
Luis Pater
ff9339feaa fix(claude): prefix Google input token limit errors with prompt is too long
- Normalize Google/Gemini invalid_request_error input token limit messages in claudeErrorDetailFromText by prepending Anthropic's canonical "prompt is too long: " prefix so Claude Code can trigger automatic compaction.
- Match "input token count" followed by an optional parenthesized count and "exceeds the maximum" while avoiding double-prefixing and preserving non-matching errors.
- Add regression tests covering JSON responses, committed SSE errors, parenthesized count variants, idempotency, non-400 statuses, and output-token-limit false positives.

Closes: #8003
2026-11-25 11:07:25 +08:00
hkfires
f89d408e75 feat(registry): unify copilot and devin published routes
Introduce SourceModelID as the canonical provider-qualified
source behind each published route and store the Devin catalog
with bare IDs, qualifying it only at publication and lookup.

Generalize Copilot's published-route selection, cooldown
migration, websocket matching, and execution resolution to
Devin, and match OAuth settings and payload rules against the
canonical source so aliases and prefixed routes share config.

Handle qualified model IDs from newer Homes, preserve explicit
prefixed alias names, and resolve Devin auto effort against
catalog-supported levels instead of defaulting to high.
2026-11-22 21:36:09 +08:00
Luis Pater
df6c8ccb96 fix(auth): preserve stream headers and honor terminal request stops
- Preserve upstream stream bootstrap headers via streamHeaderError and forward them on direct error responses without allowing bootstrap replay.
- Short-circuit terminal request-stop and unoverridden RequestTerminatedError outcomes before Home retryRoundPending waits and avoid re-evaluating inner errors across continue/stop wrappers.
- Add regression tests covering stream bootstrap stop/terminated headers, Home retryRoundPending short-circuiting, and continue-overridden 400 credential failover.

Closes: #7740
2026-11-21 13:49:45 +08:00
Luis Pater
5dff8b6728 feat(copilot): support OAuth model aliases and exact route-aware selection
- Publish Copilot catalog and plugin models with native IDs, aliases, and auth prefixes while preserving suffixed routes.
- Route requests through exact registered Copilot models and send the resolved native model upstream.
- Reconcile Copilot model states and route metadata against published routes; document Copilot support in OAuth alias and error configuration.
2026-11-21 09:54:53 +08:00
Luis Pater
6e7a1b294a fix(api): decode gzip request bodies and honor Content-Encoding on Claude routes
- Add gzip/x-gzip support to the shared request body decoder with the configured decoded-size cap, and drop Content-Encoding after a successful decode so nothing downstream decodes or forwards it again.
- Switch ClaudeMessages and ClaudeCountTokens to handlers.ReadRequestBody, and mirror the change in the plugin auth pre-decode path (gzip support, plus /v1/messages and /v1/messages/count_tokens in handlerDecodesBody) and the request-log capture decoder.

Closes: #7711
2026-11-20 10:49:38 +08:00
Luis Pater
5bfae62919 feat(plugin): support credential-scoped after-auth request termination
- Add TerminateScope to plugin and executor after-auth interceptor responses so plugins can refuse a single selected credential with exact scope "credential" while keeping request-scoped termination as default.
- Exclude refused credentials for the remainder of the request across normal, count, streaming, Home dispatch, retry rounds, and Antigravity credits fallback without mutating shared cooldown state.
- Preserve real upstream error precedence over plugin credential refusals and plugin refusal precedence over local non-upstream errors, with regression tests across pluginhost, handlers, and auth conductor paths.

Closes: #7656
2026-11-19 23:59:02 +08:00
Luis Pater
a35e8be3e3 fix(auth): honor stop rules and retry limits in antigravity credits fallback
- Enforce MaxRetryCredentials, request-scoped stop rules, TOS_VIOLATION, VALIDATION_REQUIRED, and 401/400 termination gates across Antigravity credits execution and streaming paths.
- Tighten shouldAttemptAntigravityCreditsFallback and 429 quota classification so transient rate limits, short cooldowns, and non-quota errors never trigger whole-pool credits sweeps.
- Prevent HTTP bootstrap retries from replaying pre-output stream errors on stop, TOS, or unoverridden validation failures, while preserving continue overrides and TOS credential deactivation state.

Closes: #7658
2026-11-19 22:00:17 +08:00
Luis Pater
db7f177d6b feat(codex): manage session instructions across requests
- Add session-scoped instruction baselines with validation, expiration, and optional KV storage.
- Preserve instruction state across HTTP and WebSocket turns, rejecting invalid or unreconstructable session requests.
- Prevent internal session markers from reaching upstream or request logs.
2026-11-19 08:23:04 +08:00
Luis Pater
bd2e0a98a6 feat(plugin): add explicit Kind field to ResponseInterceptRequest
- Add Kind as the leading field on pluginapi.ResponseInterceptRequest with model_list, execution, and count_tokens constants, and document fallback and open-map metadata rules.
- Populate Kind across all five response interceptor construction sites (auth-manager execute/count, plugin-executor execute/count, and WriteModelListResponse) and verify leading-byte RPC serialization and /v1/models/{id} detail routing.

Closes: #7655
2026-11-19 00:26:16 +08:00
sususu98
687caf786b feat(plugin): add optional executor usage attribution 2026-11-17 17:56:16 +08:00
hkfires
1c0ec3cec1 fix(logging): separate local errors from upstream responses
Store bounded local read, dial, and stream errors as diagnostics
instead of rendering them inside API RESPONSE sections, and render
them in the downstream RESPONSE section after status selection.
Prevent handler-synthesized payloads from appending to executor
capture or fabricating upstream responses for failed attempts.
2026-11-17 15:13:51 +08:00
Luis Pater
7fcdfcfe17 feat(plugin): add bounded Codex scheduler continuity hook
- Add optional `scheduler.continuity` plugin ABI/RPC hook with bounded `pre_admission` and `pre_output_429` wait gates, persisted cooldown provenance separation, and SSE/WebSocket keepalive handoff.
- Enforce per-request continuity budgets, `disable_cooling` retry limits, and stable turn `RequestID` across SSE bootstrap retries and WebSocket in-place failover.
- Add race-verified unit and handler integration tests covering continuity gates, cooldown provenance, keepalive suppression, and session isolation.

Closes: #7589
2026-11-17 03:22:51 +08:00
sususu98
5a373ede5b fix(codex,openai): preserve nested WS error headers and honor explicit SSE event types
- Read nested body/error HTTP status codes in parseCodexWebsocketErrorWithCooling and clearCodexReasoningReplayOnWebsocketError so Retry-After and request headers are preserved on typeless WebSocket errors.
- Guard responsesSSEPayloadHasError and SSE error inference behind explicit event/payload type checks so non-error frames such as response.metadata containing body.error are not rewritten into terminal errors.
2026-11-16 14:09:15 +08:00
sususu98
80e8350c95 fix(openai,codex): build stream errors via ojson.Doc and preserve SSE status
- Build OpenAI Responses stream error and failed chunks directly through ojson.Doc with single-exit serialization, supporting scalar error strings without map mutations.
- Preserve valid top-level and body envelope HTTP error status codes when normalizing typeless Codex SSE failures and Responses SSE frames.
- Normalize scalar and blank WebSocket error fields purely via ojson.Doc.
2026-11-16 13:50:58 +08:00
sususu98
20df0c25b2 fix(codex): preserve string errors and recognize untyped failures
Normalize string websocket errors without discarding their messages. Recognize untyped and body-wrapped failures across SSE, websocket, and duplex paths while retaining status, headers, and sequence numbers.

Cover transport and format combinations, replay invalidation, credential status precedence, and Responses framing with regression tests.
2026-11-16 12:28:56 +08:00
sususu98
1f76e479c4 fix(clienterror,openai): classify bio_policy and safety policy blocks as 400 request faults
- Add bio_policy, cyber_policy_violation, misalignment_policy_violation, content_policy_violation, and image_content_policy_violation to request-fault codes so policy rejections stop failover without cooling down credentials.
- Unify trusted error JSON extraction across auth, model-not-found, credit-balance, and request-fault checks while restricting wrapper unwrapping and policy-text matching to prevent prompt-echo false positives.
- Map typeless policy error codes and body.error layouts consistently across Codex SSE/WebSocket, Responses, xAI, and Claude stream translation paths, filling blank messages with official fallback copy.
2026-11-16 12:28:56 +08:00
Luis Pater
14144df573 fix(openai): route duplex quota errors through replay guard after response.created
- Exclude known credential quota and cooldown errors from recoverable duplex error preservation in forwardResponsesWebsocket so opts.suppressError and terminal error handling still apply after response.created.
- Add regression tests verifying usage_limit_reached and model_cooldown consult the replay guard while request and client rate-limit errors stay on the duplex path.

Closes: #7586
2026-11-16 10:43:08 +08:00
Luis Pater
508f8708d0 chore: replace standard JSON package with moego JSON throughout the project 2026-11-16 09:58:12 +08:00
Luis Pater
b4fdfdece3 chore: replace standard regexp with moego regexp throughout the project 2026-11-16 03:02:43 +08:00
Luis Pater
a8c9c8a4a4 fix(openai): fail over pre-commit responses websocket create errors
- Unpin and exclude the failed credential when a full response.create on a persistent Responses WebSocket fails with a pre-commit quota or auth error.
- Propagate excluded auth IDs through handler metadata into mixed and Home stream selection while blocking replay once any downstream frame is committed.
- Add regression tests for pre-commit 429 failover, post-commit non-replay, and Home repeated excluded-auth rejection.

Closes: #7585
2026-11-16 01:59:04 +08:00
Luis Pater
7e82d0d1ca fix(executor): skip credential cooldown on Gemini zero-output 502 errors
- Tag Gemini-family zero-output HTTP 502 errors and translated Claude MALFORMED_FUNCTION_CALL error payloads with ErrorCodeTransientTransport across Antigravity, Gemini, Vertex, and AI Studio executors so Conductor skips credential cooldown while preserving per-request rotation and cross-provider failover.
- Update existing Claude MALFORMED_FUNCTION_CALL conductor tests to assert failed execution results and failed usage metrics without placing credentials into cooldown.
- Add unit and HTTP handler regression tests verifying uncooled rotation, cross-provider failover, and groundingChunks-only Claude fallback paths across Gemini-family executors.

Closes: #7571
2026-11-15 22:00:34 +08:00
Luis Pater
4da9f68527 fix(auth): carry the pool cooldown reset on the terminal 429
- Wrap the final 429 in a poolCooldownTerminalError at the Execute/ExecuteCount/ExecuteStream boundaries when every candidate credential for the model is blocked and at least one is in a timed cooldown, preserving the upstream error body and status while marking IsModelCooldown so the Claude handler appends the reset time.
- Compute the Retry-After from the earliest auto-recovery across all blocked candidates (including non-cooldown timed blocks) so the client sees the pool's real recovery instead of the last attempt's hint.
- Add regression coverage for both cooldown variants across the three execution paths, the available-candidate guard, mixed-block earliest deadlines, the sub-floor hint clamp, and the Claude handler end-to-end.

Closes: #7521
2026-11-14 03:53:47 +08:00
Luis Pater
100f2de1a5 fix(handlers): forward caller identity metadata to model-directory response interceptors
- Build interceptor metadata in WriteModelListResponse from the authenticated gin context (caller_scope, access_provider, frontend_auth_metadata) instead of always passing nil.
- Reuse requestCallerScope so model-list requests share the same irreversible caller handle as execution paths, enabling per-key catalog filtering including ?key= credentials.
- Forward the same metadata to the request lifecycle tracker and add regression tests for identity forwarding, metadata isolation, and unauthenticated nil metadata.

Closes: #7524
2026-11-14 03:38:08 +08:00
Luis Pater
cf07c78abd fix(gemini/antigravity): fail zero-output abnormal terminations before HTTP 200 commit
- Detect MALFORMED_FUNCTION_CALL, UNEXPECTED_TOOL_CALL, and MALFORMED_RESPONSE with zero visible output before bootstrap commit, reasoning replay caching, or usage finalization across Antigravity, Gemini, Vertex, and AI Studio executors.
- Withhold only contentless leading shell frames while keeping thought chunks unbuffered for TTFT, and align Claude response error handling and stream completion flags while preserving valid partial outputs.
- Add unit, executor, bootstrap failover, and cross-module HTTP regression tests covering credential rotation and HTTP 502 exhaustion.

Closes: #7513
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-14 00:50:21 +08:00
Luis Pater
6acfb76b54 feat(sdk): keep caller-provided interceptor host and executor wrappers across config apply
- Add Builder.WithPluginInterceptorHost so embedders can install a custom PluginInterceptorHost that survives startup and reload; the server wraps it to keep plugin model routing, executor dispatch, lifecycle, and websocket observers delegated to the internal plugin host.
- Add Hooks.OnConfigApplied invoked after each successful config apply so embedders can reinstall executor wrappers and other caller-owned runtime state.
- Cover the delegated interceptor host with nil-safety, skip-forwarding, capability-detection, and real execute-chain regression tests.

Closes: #7499
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-13 07:53:46 +08:00
Luis Pater
ece3f52a41 fix(logging): preserve bounded upstream responses in error logs
- Capture bounded per-attempt upstream status, masked headers, response chunks, and transport or stream errors when request-log is false.
- Bind synchronized deferred capture to the HTTP request context and preserve partial HTTP bodies and WebSocket dial or reconnect failures.
- Mask Cookie headers alongside Set-Cookie so forced error logs do not expose session credentials.

Closes: #7420
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-11 03:31:39 +08:00
Luis Pater
cb70eacfa5 fix(claude): emit anthropic-ratelimit-unified headers on local cooldown 429s
- Retain and persist rejected Claude unified quota signals alongside active cooldown deadlines so out-of-order completions, restarts, and dual-layer quota wraps keep accurate window metadata.
- Populate anthropic-ratelimit-unified-* headers on Claude quota modelCooldownError responses aligned with Retry-After while keeping SafeResponseHeaders restricted to trusted retry headers.
- Exclude non-Claude, Cloudflare challenge, and ordinary per-minute rate-limit cooldowns from unified subscription quota header synthesis across selector and scheduler paths.

Closes: #7417
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-11 01:20:48 +08:00
sususu98
61f1ad5e3e fix(codex): support local compaction for compatible Responses endpoints
Handle compaction triggers and capsule replay locally for is-compat models while preserving native Codex behavior. Harden duplex cancellation, event ordering, response ownership, settings inheritance, model aliases, and credential failure classification.

Add HTTP, streaming, duplex, handler, usage, and deterministic concurrency regression coverage.

Fixes #7406
2026-11-10 19:22:38 +08:00
Luis Pater
46d48eb5af fix(openai): start responses websocket keepalive after upgrade
- Start a connection-scoped downstream Ping keepalive loop immediately after upgrading the Responses WebSocket connection instead of waiting for stream forwarding to begin.
- Guard background Ping writes with non-blocking mutex acquisition so active data writes are not contended while blocked Ping writes are still interrupted on terminal close.
- Preserve the socket cancellation cause in response forwarding and add regression coverage for post-upgrade, upstream-bootstrap, and blocked-Ping close paths.

Closes: #7407
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-10 17:36:17 +08:00
Luis Pater
23e31fe288 fix(executor): stabilize Codex refresh and websocket tests under CPU contention
- Hijack mock CONNECT proxy connections before writing 200 OK and forward buffered client bytes so TLS ClientHello records are not truncated under CPU contention, while isolating Codex refresh test journals.
- Wait for client request payloads and test completion before closing mock websocket connections in Codex keepalive upload tests.
- Cancel the in-flight HTTP upstream context before writing response.incomplete downstream during local websocket interrupts.

Closes: #7379
Co-authored-by: Dylan <1990016@gmail.com>
2026-11-09 22:44:41 +08:00
Luis Pater
05e668cf2d fix(responses): sanitize orphan tool outputs lacking call_id
- Rewrite standalone function_call_output and custom_tool_call_output items without call_id into user messages while preserving paired tool outputs and multimodal content parts.
- Apply orphan tool output sanitization in both Codex Responses request translation and the Responses HTTP/compact handlers while keeping codex_app delegation compatibility intact.
- Add regression tests covering orphan Companion Page outputs, multimodal array outputs, paired tool calls, and HTTP/compact endpoints.

Closes: #7341
2026-11-08 14:46:03 +08:00
Luis Pater
91e0dee827 fix(openai): prevent SSE keep-alive injection mid-line during image streaming
- Track SSE event newline boundaries across streamed image chunks and suppress keep-alive comments while inside an incomplete SSE event.
- Reset streaming keep-alive tickers when downstream bytes are written and ensure terminal error events start on a clean SSE boundary.

Closes: #7330
2026-11-08 02:02:31 +08:00
Luis Pater
f4d3f0618d fix(openai): replace responses websocket transcript when pending tool calls are unanswered
- Treat subsequent responses websocket requests without previous_response_id that leave pending tool calls unanswered as transcript replacements regardless of incremental upstream mode.
- Add regression tests covering both unanswered and answered pending tool calls when incremental previous_response_id injection is disabled.

Closes: #7320
2026-11-07 17:09:50 +08:00
Luis Pater
e458999bb3 fix(claude): show cooldown retry time in error messages
- Include the trusted retry delay in Claude cooldown errors.
- Verify response headers and stream messages across cooldown cases.

Closes: #7285
2026-11-06 10:25:22 +08:00
Luis Pater
8fb60326f4 fix(codex): handle Responses-Lite hosted image_generation compatibility
- Skip auto-injecting hosted image_generation tools on Responses-Lite models and strip unsupported complexity fields from declared image_generation tools on ChatGPT Codex /responses requests.
- Route forced hosted image_generation turns on Responses-Lite models to the compatible GPT-Image-2 base model (default gpt-5.4-mini) with normalized reasoning configuration.
- Map upstream image_generation_user_error terminal events to HTTP 400 Bad Request with actionable remediation guidance for unsupported complexity errors.

Closes: #7270
2026-11-05 18:28:39 +08:00
Luis Pater
b5e6027ce4 fix(openai): expose terminal 429 error frames on responses websocket
- Forward terminal 429 quota and model-cooldown errors with trusted Retry-After headers when websocket credential failover is exhausted.
- Suppress 1012 HTTP replay on pinned continuation 429 failures when no alternative local or Home credential is eligible.
- Add regression tests covering multi-credential rotation, single-credential exhaustion, expired alternatives, and Home failover.

Closes: #7256
2026-11-05 10:38:56 +08:00
sususu98
6897eebd50 Merge pull request #7242 from sususu98/fix/cyber-block-request-fault-and-error-log
fix(clienterror,logging): classify mid-stream cyber blocks as 400 and persist error logs
2026-11-05 09:53:35 +08:00
sususu98
be69162478 fix(executor,logging): preserve Antigravity usage evidence, sparse Claude refusal identity, and Home stream error logs 2026-11-05 09:51:14 +08:00
赵铕杭
7a7d37ecb5 feat(codex): add support for gpt-image-2.6 models 2026-11-05 08:59:25 +08:00
Luis Pater
f208c90824 fix(handlers): record TTFT for direct plugin executor routes
- Start TTFT timing before invoking direct plugin executors in both non-streaming and streaming handler paths.
- Record first-packet arrival for non-streaming responses and observe protocol-aware stream chunk TTFT events before publishing usage.

Closes: #7253
2026-11-05 07:21:50 +08:00