Skip to content

proxy: purpose-routed embeddings/decisions/rerank/audio/guard + A2 batch (#13675 P2) - #13803

Merged
dezren39 merged 1 commit into
mainfrom
lane/rt1-13675-part2-proxy
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane/rt1-13675-part2-proxy

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Part 2 of code#13675. Do NOT merge from here; merge via the normal queue lane.

What this adds to bin/opencode-route-proxy.mjs:

  • loadConfig reads model_designations from the config FILE (opencode#2782 projection gap — never from the server projection).
  • Purpose routing: routePurpose, designatedPurposes, checkEndpointAccess (unknown route 404 on new endpoints, pool-purpose mismatch 400), prepareCandidates (resolution, demotion, exhausted gate, designation enforcement, credential filter).
  • Native descriptor dispatch: endpointDescriptor, buildLeafRequest, postLeaf with google-embed branch (:embedContent/:batchEmbedContent, x-goog-api-key); google-decisions, jev-systemone (provisional shape), fireworks/baseten/modal passthrough kinds; unknown kinds never invent a surface; decisions have NO OpenAI default.
  • A2 batch: runSingleShotJson, runAudioPassthrough (no per-leaf first-response timeout; overall deadline applies), embedMaxBatch, extractEmbedVectors, isRetryableLeafError, runEmbeddingsA2/Direct — split at per-request limit, re-join index-faithful; retryable sub-batch failure fails over, non-retryable 4xx answers 207 with per-item errors.
  • Handlers + POST routes: /v1/embeddings, /v1/decisions, /v1/rerank, /v1/audio/transcriptions, /v1/audio/speech, /v1/guard (chat-shaped). Chat unknown-route stays 502.
  • A3 autobatch POSTPONED with evidence: 6 concurrent single-item embeds issue 6 leaf calls (no coalescing); correctness unaffected.

Tests: 17 new Part 2 tests (native dispatch, guards, A2 split/re-join ordering, 207 partials, failover, designation filtering, audio/guard passthrough). 80/80 green; check-opencode-route-rules passes.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T22:02:46Z",
    "session_id": "ses_e5df5a5f4b8ffe77EyeP1BL95e",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/wt-rt1-13675-part2",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/wt-rt1-13675-part2",
      "repo": "developing-today/code",
      "branch": "lane/rt1-13675-part2-proxy",
      "sha": "5f42bcd7cc41edd48235707de37da82343a9eaa8"
    },
    "auth_subject": "oc-code-01",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Proof this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…tive dispatch + A2 batch (#13675 P2)

- loadConfig reads model_designations from the config file (opencode#2782 gap)
- routePurpose/designatedPurposes/checkEndpointAccess/prepareCandidates
- endpointDescriptor/buildLeafRequest/postLeaf with google-embed native branch
- runSingleShotJson/runAudioPassthrough/embedMaxBatch/extractEmbedVectors
  /isRetryableLeafError/runEmbeddingsA2(+Direct); handlers + POST routes x6
- test fixture: purpose routes, endpoint descriptors, designations;
  17 new Part 2 tests (native dispatch, guards, A2 order/partials/failover)
- A3 autobatch postponed with evidence (6 concurrent singles -> 6 leaf calls)
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f21288be-b91a-403d-891a-ed719215e13a
Commits

Reviewing files that changed from the base of the PR and between a77026e and 5f42bcd.

Files selected for processing: 3

  • bin/opencode-route-proxy.mjs
  • bin/opencode-route-proxy.test.mjs
  • bin/request-body.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@dezren39
dezren39 merged commit 6790c8a into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the lane/rt1-13675-part2-proxy branch November 23, 2026 23:19
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant