Skip to content

fix(oauth-url): make the authorization link survive terminal wrapping (SUPPORT-17391) - #707

Closed
ZoraJel wants to merge 4 commits into
mainfrom
SUPPORT-17391
Closed

fix(oauth-url): make the authorization link survive terminal wrapping (SUPPORT-17391)#707
ZoraJel wants to merge 4 commits into
mainfrom
SUPPORT-17391

Conversation

@ZoraJel

@ZoraJel ZoraJel commented Aug 26, 2026

Copy link
Copy Markdown

Summary

config oauth-url prints a ~200-char URL (token + encoded sapiUrl + #/<component>/<config>), so it never fits one terminal row. Two layers then truncate it, and both produce the same misleading browser error — Failed to load config data. Please contact us on support@keboola.com — because token/sapiUrl come first and survive while the config_id in the fragment is lost:

  • Rich laid the URL out at the console width and inserted real newlines into it, so any copy (or line-based parse) got a fragment.
  • Terminals and chat renderers autodetect URLs per visual row, so a wrapped URL becomes a link to its first row only.

Fixes:

-formatter.console.print(f"  [link]{result['url']}[/link]")          # style tag, not OSC-8; hard-wrapped
+formatter.console.print(f"[link={url}]Authorize in browser[/link]") # short anchor, cannot wrap
+formatter.console.print(url, soft_wrap=True, highlight=False, markup=False)

The click target is now a one-row label carrying the full URL as the OSC-8 target, so no wrapping can truncate it; the URL is still printed verbatim on one unwrapped line for copy/paste. Also adds --open, which hands the complete URL to the existing auth.environment.open_browser (JSON then reports opened_in_browser) for terminals without hyperlink support.

kai ask / kai chat / kai chat-detail printed assistant answers through console.print(...) with default layout, so a URL inside an answer got the same destructive Rich newlines — those now pass soft_wrap=True.

--json (data.url) was never affected.

Docs: commands-reference.md + a gotchas.md entry tell agents to use --open (or --json) instead of pasting the link into a chat transcript, since a wrapping renderer is outside kbagent's control.

Unchanged on purpose: token TTL (1 h vs the UI's 48 h) and any config preflight before minting the token.

Release Notes

Fixed the config oauth-url authorization link being truncated by terminal wrapping (which surfaced as "Failed to load config data" in the OAuth wizard): the clickable target is now a short Authorize in browser label carrying the whole URL, the URL is printed unwrapped, and a new --open flag launches it in the default browser. Kai answers are no longer hard-wrapped either.

Link to Devin session: https://app.devin.ai/sessions/e0d8eb25504b4b7cb6b1f9c354d448e3
Requested by: @ZoraJel

Co-Authored-By: Zora Jelínková <zora.jelinkova@keboola.com>
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

…T-17391)

Co-Authored-By: Zora Jelínková <zora.jelinkova@keboola.com>
@devin-ai-integration devin-ai-integration Bot changed the title fix(config): keep oauth-url link intact and clickable (SUPPORT-17391) fix(config): make oauth-url link usable — no hard wrap, real hyperlink, --open (SUPPORT-17391) Aug 26, 2026
devin-ai-integration Bot and others added 2 commits August 26, 2026 18:43
…-17391)

Co-Authored-By: Zora Jelínková <zora.jelinkova@keboola.com>
… agents (SUPPORT-17391)

Co-Authored-By: Zora Jelínková <zora.jelinkova@keboola.com>
@devin-ai-integration devin-ai-integration Bot changed the title fix(config): make oauth-url link usable — no hard wrap, real hyperlink, --open (SUPPORT-17391) fix(oauth-url): make the authorization link survive terminal wrapping (SUPPORT-17391) Aug 26, 2026
@devin-ai-integration
devin-ai-integration Bot deleted the SUPPORT-17391 branch August 26, 2026 19:15
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