Skip to content

fix(learning): repair MODEL_ENDPOINT 400 in the retrospective cron - #906

Merged
eric-wang-1990 merged 1 commit into
mainfrom
ai/fix-learning-endpoint-400
Aug 13, 2026
Merged

fix(learning): repair MODEL_ENDPOINT 400 in the retrospective cron#906
eric-wang-1990 merged 1 commit into
mainfrom
ai/fix-learning-endpoint-400

Conversation

@eric-wang-1990

Copy link
Copy Markdown
Contributor

What

Fix the MODEL_ENDPOINT in engineer-bot-learning.yml: .../serving-endpoints/anthropic/invocations.../serving-endpoints/databricks-claude-opus-4-8/invocations.

Why (follow-up to #905)

#905 bumped the engine pin but merged before this endpoint fix landed — so the learning cron on main is still broken. The daily scheduled run fails every time with:

API Error: 400 Unsupported native API path
'/serving-endpoints/anthropic/invocations/v1/messages' for provider 'anthropic'

Root cause: sdk_agent.translate_endpoint early-returns on URLs already containing /serving-endpoints/anthropic, keeping the trailing /invocations. The CLI then appends /v1/messages, producing the rejected path. The concrete .../serving-endpoints/databricks-claude-opus-4-8/invocations form (used by reviewer-bot.yml / engineer-bot.yml, which run successfully) is stripped by translate_endpoint to the correct .../serving-endpoints/anthropic base.

The model segment in the URL is cosmetic — the effective model is engine-owned (repo_conventions.engineer_bot_model()); this is a routing/base-URL fix only. Same fix is going out to the sibling driver repos' learning PRs.

Validation

Post-merge, the daily cron should stop 400ing. Can be checked immediately with a manual workflow_dispatch (recent since).

This pull request and its description were written by Isaac.

…t form

The learning workflow set MODEL_ENDPOINT to
`.../serving-endpoints/anthropic/invocations`. That is NOT translated the way the
old comment claimed: sdk_agent.translate_endpoint has an early-return for URLs
already containing `/serving-endpoints/anthropic`, which keeps the trailing
`/invocations` — so the CLI appends `/v1/messages` and calls
`.../serving-endpoints/anthropic/invocations/v1/messages`, which the gateway
rejects with `400 Unsupported native API path`.

Proof: databricks-sql-python's learning cron (same endpoint form) has failed
every scheduled run with exactly this 400. The reviewer-bot flagged it on the
sibling PRs (Low), and it is the real cause.

Use the concrete `.../serving-endpoints/databricks-claude-opus-4-8/invocations`
form that reviewer-bot.yml / engineer-bot.yml already use successfully:
translate_endpoint strips `<model>/invocations` to the `.../serving-endpoints/
anthropic` base the CLI needs. Comment corrected to explain the trap.

Co-authored-by: Isaac
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the engineer-bot learning (retrospective) GitHub Actions workflow to use the correct Databricks serving endpoint URL format so the engine/CLI endpoint translation produces a valid Anthropic native API base path and avoids the scheduled cron’s HTTP 400 failures.

Changes:

  • Switch MODEL_ENDPOINT in engineer-bot-learning.yml from the problematic /serving-endpoints/anthropic/invocations form to the concrete /serving-endpoints/databricks-claude-opus-4-8/invocations form used by other bot workflows.
  • Expand inline workflow comments to document the endpoint-translation failure mode and the rationale for the concrete endpoint URL.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@eric-wang-1990
eric-wang-1990 added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit 5574e01 Aug 13, 2026
49 of 50 checks passed
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.

2 participants