Skip to content

feat: plugin interface and tests added#2

Closed
Pratham-Mishra04 wants to merge 1 commit intographite-base/2from
03-21-feat_plugin_interface_and_tests_added
Closed

feat: plugin interface and tests added#2
Pratham-Mishra04 wants to merge 1 commit intographite-base/2from
03-21-feat_plugin_interface_and_tests_added

Conversation

@Pratham-Mishra04
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Collaborator Author

Pratham-Mishra04 commented Mar 21, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@danpiths danpiths self-requested a review March 21, 2025 12:14
This was referenced Mar 21, 2025
@Pratham-Mishra04 Pratham-Mishra04 changed the base branch from feature/03-21-base_structure_fixes to graphite-base/2 March 31, 2025 07:57
@Pratham-Mishra04 Pratham-Mishra04 deleted the 03-21-feat_plugin_interface_and_tests_added branch April 30, 2025 07:02
@greptile-apps greptile-apps Bot mentioned this pull request Apr 13, 2026
18 tasks
thiscantbeserious added a commit to thiscantbeserious/bifrost that referenced this pull request Apr 17, 2026
CodeRabbit round 2:

10. /models query-param fallback now checks for existing client_version
    before injecting. Preserves caller-supplied params like foo=bar and
    picks up caller's own client_version when present. Uses simple
    string split (no net/url allocation) since paths are well-formed.

11. chatGPTOAuthWebSocketHeaders now routes through
    mergeHeadersCaseInsensitive so caller-supplied headers with
    different casing (OPENAI-BETA, Openai-Beta, etc.) can't cause
    duplicate-case headers reaching the wire — OAuth values and the
    Authorization bearer always win deterministically.

Greptile findings:

P1 maximhq#1 Non-streaming Responses() path: return a clear BifrostOperationError
      pointing callers to ResponsesStream when chatgpt_oauth is on.
      The ChatGPT backend only accepts stream=true (matching the
      openai-oauth reference proxy behavior), so non-streaming cannot
      work via Bifrost without server-side SSE aggregation which is
      out of scope for this PR. In practice Codex always streams.

P1 maximhq#2 /models response format: OpenAIListModelsResponse now has a
      UnmarshalJSON that accepts BOTH the standard OpenAI shape
      ({"data":[{id,...}]}) and the ChatGPT backend shape
      ({"models":[{slug}]}). ChatGPT entries are projected into
      OpenAIModel with ID=slug, Object="model", OwnedBy="chatgpt-oauth".

P2 maximhq#3 client_version doc comment: corrected — the fallback only
      applies when the inbound path reaches chatGPTOAuthPath without
      a caller-supplied client_version (previously the doc implied
      forwarding logic that didn't exist; it now does).

P2 maximhq#4 store doc comment: corrected from "sets store to false if not
      already present" to "forces store to false" to match the code
      and explanation.

P2 maximhq#5 Double JWT decode per Responses/ResponsesStream: fixed by
      passing raw networkConfig.ExtraHeaders to chatGPTOAuthApplyRequest
      instead of the already-merged effectiveExtraHeaders(key). The
      merge now happens exactly once per call.

Test coverage: 100% on every function in chatgpt_oauth.go. Added tests
for query-param preservation, models dual-shape parsing, and the
streaming-only sentinel error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thiscantbeserious added a commit to thiscantbeserious/bifrost that referenced this pull request Apr 24, 2026
CodeRabbit round 2:

10. /models query-param fallback now checks for existing client_version
    before injecting. Preserves caller-supplied params like foo=bar and
    picks up caller's own client_version when present. Uses simple
    string split (no net/url allocation) since paths are well-formed.

11. chatGPTOAuthWebSocketHeaders now routes through
    mergeHeadersCaseInsensitive so caller-supplied headers with
    different casing (OPENAI-BETA, Openai-Beta, etc.) can't cause
    duplicate-case headers reaching the wire — OAuth values and the
    Authorization bearer always win deterministically.

Greptile findings:

P1 maximhq#1 Non-streaming Responses() path: return a clear BifrostOperationError
      pointing callers to ResponsesStream when chatgpt_oauth is on.
      The ChatGPT backend only accepts stream=true (matching the
      openai-oauth reference proxy behavior), so non-streaming cannot
      work via Bifrost without server-side SSE aggregation which is
      out of scope for this PR. In practice Codex always streams.

P1 maximhq#2 /models response format: OpenAIListModelsResponse now has a
      UnmarshalJSON that accepts BOTH the standard OpenAI shape
      ({"data":[{id,...}]}) and the ChatGPT backend shape
      ({"models":[{slug}]}). ChatGPT entries are projected into
      OpenAIModel with ID=slug, Object="model", OwnedBy="chatgpt-oauth".

P2 maximhq#3 client_version doc comment: corrected — the fallback only
      applies when the inbound path reaches chatGPTOAuthPath without
      a caller-supplied client_version (previously the doc implied
      forwarding logic that didn't exist; it now does).

P2 maximhq#4 store doc comment: corrected from "sets store to false if not
      already present" to "forces store to false" to match the code
      and explanation.

P2 maximhq#5 Double JWT decode per Responses/ResponsesStream: fixed by
      passing raw networkConfig.ExtraHeaders to chatGPTOAuthApplyRequest
      instead of the already-merged effectiveExtraHeaders(key). The
      merge now happens exactly once per call.

Test coverage: 100% on every function in chatgpt_oauth.go. Added tests
for query-param preservation, models dual-shape parsing, and the
streaming-only sentinel error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant