-
Notifications
You must be signed in to change notification settings - Fork 180
Tell users to update the CLI when the Genie API drifts or disappears #5570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
2e46228
Tell users to update the CLI when the Genie API drifts or disappears
simonfaltum d1c6acb
Do not blame the endpoint for 404s about request-named resources
simonfaltum 0a2277f
Add update advice to 500s, the observed shape for request-format drift
simonfaltum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
acceptance/experimental/genie/ask-endpoint-gone/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
|
|
||
| === a removed endpoint tells the user to update the CLI | ||
| >>> [CLI] experimental genie ask What are total sales by franchise? | ||
| Error: the Genie API is not available on this workspace: No API found for 'POST /data-rooms/tools/onechat/responses'; the endpoint may have moved since this CLI release: update the Databricks CLI to the latest version (run 'databricks version --check') | ||
|
|
||
| Exit code: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| title "a removed endpoint tells the user to update the CLI" | ||
| errcode trace $CLI experimental genie ask "What are total sales by franchise?" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # No bundle engine needed for this command. | ||
| [EnvMatrix] | ||
| DATABRICKS_BUNDLE_ENGINE = [] | ||
|
|
||
| # The genie route is an undocumented API that can disappear between releases. | ||
| # This is the wire shape a live workspace gateway returns for a removed route. | ||
| [[Server]] | ||
| Pattern = "POST /api/2.0/data-rooms/tools/onechat/responses" | ||
| Response.StatusCode = 404 | ||
| Response.Body = ''' | ||
| {"error_code":"ENDPOINT_NOT_FOUND","message":"No API found for 'POST /data-rooms/tools/onechat/responses'"} | ||
| ''' |
3 changes: 3 additions & 0 deletions
3
acceptance/experimental/genie/ask-protocol-drift/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
acceptance/experimental/genie/ask-protocol-drift/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
|
|
||
| === a drifted protocol with no renderable answer tells the user to update the CLI | ||
| >>> [CLI] experimental genie ask What are total sales by franchise? | ||
| Error: the stream ended without an answer (received 2 events); the API may have changed: update the Databricks CLI to the latest version (run 'databricks version --check'), or re-run with --raw to inspect the raw stream | ||
|
|
||
| Exit code: 1 | ||
|
|
||
| === json output also reports the drift | ||
| >>> [CLI] experimental genie ask What are total sales by franchise? --output json | ||
| { | ||
| "status": "error", | ||
| "error": "the stream ended without an answer (received 2 events); the API may have changed: update the Databricks CLI to the latest version (run 'databricks version --check'), or re-run with --raw to inspect the raw stream" | ||
| } | ||
| Error: the stream ended without an answer (received 2 events); the API may have changed: update the Databricks CLI to the latest version (run 'databricks version --check'), or re-run with --raw to inspect the raw stream | ||
|
|
||
| Exit code: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| title "a drifted protocol with no renderable answer tells the user to update the CLI" | ||
| errcode trace $CLI experimental genie ask "What are total sales by franchise?" | ||
|
|
||
| title "json output also reports the drift" | ||
| errcode trace $CLI experimental genie ask "What are total sales by franchise?" --output json |
15 changes: 15 additions & 0 deletions
15
acceptance/experimental/genie/ask-protocol-drift/test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # No bundle engine needed for this command. | ||
| [EnvMatrix] | ||
| DATABRICKS_BUNDLE_ENGINE = [] | ||
|
|
||
| # A protocol change that renames item types (or moves the answer elsewhere) | ||
| # leaves the stream syntactically valid but free of anything this build can | ||
| # render. The command must fail with update advice, not exit 0 with no output. | ||
| [[Server]] | ||
| Pattern = "POST /api/2.0/data-rooms/tools/onechat/responses" | ||
| Response.Body = ''' | ||
| data: {"type":"response.output_item.added","output_index":0,"item":{"type":"agent_step_v2","id":"s1","status":"completed"}} | ||
|
|
||
| data: {"type":"response.completed","response":{"id":"resp_1","status":"completed","conversation_id":"conv_1"}} | ||
|
|
||
| ''' |
3 changes: 3 additions & 0 deletions
3
acceptance/experimental/genie/ask-request-drift/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
|
|
||
| === a 500 with no message points at a possible request format change | ||
| >>> [CLI] experimental genie ask What are total sales by franchise? | ||
| Error: the Genie backend could not process the request (500 with no details); if this keeps happening, the request format may have changed since this CLI release: update the Databricks CLI to the latest version (run 'databricks version --check') | ||
|
|
||
| Exit code: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| title "a 500 with no message points at a possible request format change" | ||
| errcode trace $CLI experimental genie ask "What are total sales by franchise?" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # No bundle engine needed for this command. | ||
| [EnvMatrix] | ||
| DATABRICKS_BUNDLE_ENGINE = [] | ||
|
|
||
| # Wire shape observed live when the backend cannot interpret the request body | ||
| # (e.g. the expected request shape changed): a 500 INTERNAL_ERROR with an | ||
| # empty message, which would otherwise render as a blank "Error: ". | ||
| [[Server]] | ||
| Pattern = "POST /api/2.0/data-rooms/tools/onechat/responses" | ||
| Response.StatusCode = 500 | ||
| Response.Body = ''' | ||
| {"error_code":"INTERNAL_ERROR","message":""} | ||
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any other errors, like 500s when the shape of the body is wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I probed the live endpoint to find out:
input): returns 500INTERNAL_ERRORwith an empty message, which rendered as a literal blankError:. Added handling in 0a2277f: 500s now carry the same hedged advice ("if this keeps happening, the request format may have changed..."), and the no-details case gets explicit wording since there is no server message to pass through.warehouseIdwith a valid body: returns 200 and the failure arrives in-stream, so it is handled by the SSE error path and never hits the transport-level branches.Response-shape drift (items the CLI cannot parse, or a stream with no answer) is covered separately by the renderer checks, which also point at a CLI update now.