Commit Graph
8 Commits
Author SHA1 Message Date
Rohit C Prasad 87b4eebc15 Merge main into feature/permission-modes
Union resolutions in the four files both sides touched; approval-card sizes settle on the type-scale tokens.
2026-08-23 01:01:57 -07:00
Devika Verma a217511d50 Responses stream: rebuild the turn when the terminal event's output is empty
Some backends only stream output items and never repeat them on completed;
collect output_item.done as the fallback so text and tool calls survive.
2026-08-21 16:27:25 -07:00
Devika Verma 9ac59aafe3 Merge branch 'main' of https://github.com/andrewyng/openworker into feature/permission-modes
# Conflicts:
#	tests/test_openai_responses.py
2026-08-20 09:01:15 +05:30
Devika Verma a990f6872f OPE-101: extract token usage in the OpenAI Responses provider
Any model routed through /v1/responses (gpt-5.6+ with tools, i.e. the
default gpt-5.6-sol) reported 0 tokens for every call: both
AssistantTurn constructions omitted usage while every sibling adapter
populated TokenUsage. First consumer to notice was the Auto-Approve
reviewer metering; the 2026-08-13 eval report printed 'Tokens: 0 in /
0 out' across ~40 live calls.

_usage_from maps the Responses shape like the Chat Completions adapter:
fresh input = input_tokens - cached_tokens (input_tokens is INCLUSIVE
of the cached share), cached share -> cache_read, output_tokens as-is
(reasoning already included). Defensive reads: compat servers may omit
input_tokens_details; a missing usage object stays None, never a fake
zero. Wired in _parse_response, which both complete() and the stream's
terminal response.completed event flow through - one extraction, both
paths.

Tests: cache split, partial/missing degradation, stream terminal event,
stream-without-terminal stays None. Verified live against gpt-5.6-sol:
call 1 'in=1820 cache_read=0', call 2 'in=3 cache_read=1817' - the
0-token era ends and the cache split reports correctly.
2026-08-17 22:57:18 +05:30
fanziqing 557723bf64 fix: make Responses reasoning summaries configurable 2026-08-14 17:56:51 +08:00
fanziqing d0103947c3 feat: support custom Responses endpoints 2026-08-14 16:53:50 +08:00
Devika Verma 9d3f6d389d Route native OpenAI (blank endpoint) to the Responses provider
_build_openai: no custom base_url -> OpenAIResponsesProvider; a custom
endpoint (Azure /openai/v1, vLLM, compat gateways) keeps the Chat
Completions OpenAIProvider, as do Ollama and every compat vendor. Verify
path (raw GET /models) and matrix ids are untouched.
2026-07-28 20:48:43 +05:30
Devika Verma 26b4c80b32 OpenAI Responses provider: reasoning + tools for native OpenAI models
/v1/chat/completions rejects function tools with any reasoning_effort
other than none on GPT-5.6, so native OpenAI has run with reasoning OFF.
OpenAIResponsesProvider speaks /v1/responses instead: reasoning + tools
at real effort, streamed reasoning summaries into the existing
reasoning_delta plumbing, and CoT continuity across tool round-trips via
store:false + encrypted reasoning replayed through a new _openai message
sidecar (same extras contract as _anthropic/_gemini). Not routed yet.
2026-07-28 20:45:31 +05:30