Skip to content

[Fix] Copilot GPT-5.x task helpers fail on the wrong endpoint - #3666

Merged
mrubens merged 1 commit into
developfrom
fix/copilot-helper-provider-activation
Nov 4, 2026
Merged

mrubens merged 1 commit into
developfrom
fix/copilot-helper-provider-activation

Conversation

@roomote-roomote

Copy link
Copy Markdown
Contributor

​Opened on behalf of @mrubens. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

Related issue

Addresses the Copilot endpoint-routing finding on #3665.

Why this PR exists

  • A maintainer explicitly invited this PR in the linked issue or discussion
  • I am a maintainer / this is internal Roomote work

The promotion PR remains frozen at 38325e3559771e99e1e0efb7e8406262002b8683. Its code-review check reports this finding; the observed build, test, lint, typecheck and CodeQL checks passed. This separate fix branches from current develop (37aa060482a54f4b8a2dcc4f864c1b2c4542b139) and targets develop. It does not refresh the release candidate or authorize release promotion.

What changed

Copilot GPT-5.x task helpers selected /chat/completions, which Copilot rejects. Enable the provider before OpenCode's custom-loader pass using the helper's existing task inference token, matching the activation pattern already used by sandbox tasks.

Changed files:

  • packages/cloud-agents/src/server/opencode-runtime.ts: activate Copilot within the existing shared helper rebasing function; retain gateway routing and auth isolation.
  • packages/cloud-agents/src/server/__tests__/task-helper-subscription-transport.test.ts: replace prefix-only assertions with exact Copilot /responses and ChatGPT /v1/responses endpoint checks.

Impact: restores the intended Copilot helper transport without new state, dependencies or configuration choices. Existing gateway denial handling and shared OAuth storage preservation remain covered.

How it was tested

Using pinned OpenCode 1.18.30, synthetic OAuth credentials and a local HTTP gateway (no live-provider inference):

  • Before the runtime fix, the strengthened transport test failed only for Copilot: expected /api/inference/github-copilot/responses, received /api/inference/github-copilot/chat/completions; the ChatGPT control passed.
  • After the fix, ROOMOTE_TEST_OPENCODE_SUBSCRIPTIONS=1 pnpm exec dotenvx run -f .env.test -- pnpm --filter @roomote/cloud-agents exec vitest run src/server/__tests__/task-helper-subscription-transport.test.ts src/server/__tests__/opencode-runtime.test.ts passed 52/52 tests. This exercises the real CLI and OAuth plugins, exact HTTP routes, task bearer authorization, safety-stop propagation and preservation of shared OAuth storage.
  • pnpm --filter @roomote/cloud-agents check-types:fast passed.
  • Commit hooks passed formatting and local Judgement; push hooks passed oxlint, residual web/worker ESLint, repository-wide check-types:fast (27 package tasks), and knip.
  • git diff --check passed. Browser proof is not applicable to this backend-only transport change. Live Copilot service acceptance was not exercised; the decisive regression boundary is the real OpenCode request arriving at the controlled gateway.

Checklist

  • The PR title follows the repo convention: [Fix], [Feat], [Improve], [Refactor], [Docs], or [Chore] followed by a user-facing description
  • This PR is small and scoped to one change
  • pnpm lint and pnpm check-types pass locally
    • Fast lint/typecheck equivalents passed through the pre-push hook; full formatting-inclusive commands were not run.
  • I added tests or included a clear manual validation note above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset
    • No changeset added for this bounded follow-up to the existing release review finding.

@roomote-community

roomote-community Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

No code issues found. See session

Reviewed Copilot early activation, task-token propagation, gateway/auth isolation, and exact endpoint assertions against the existing sandbox pattern. CI tests, lint, type checks, and CodeQL passed. The real-CLI subscription transport test is opt-in; its reported local run was not independently repeated during review.

Reviewed 761673c

@roomote-roomote
roomote-roomote Bot marked this pull request as ready for review November 4, 2026 14:43
@mrubens
mrubens merged commit 57aa1a2 into develop Nov 4, 2026
25 checks passed
@mrubens
mrubens deleted the fix/copilot-helper-provider-activation branch November 4, 2026 14:59
@roomote-roomote roomote-roomote Bot mentioned this pull request Nov 5, 2026
8 of 11 tasks
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