Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(backends): auto-add scheme on OpenCode callback URL paste

cyha926c9edf5b1
diff --git a/core/agent_auth_service.py b/core/agent_auth_service.py
index 383689f88..a8998a415 100644
--- a/core/agent_auth_service.py
+++ b/core/agent_auth_service.py
@@ -1754,9 +1754,23 @@ class AgentAuthService:
The Settings UI exposes a paste box; we GET the URL from inside
the container so OpenCode's own listener consumes it.
"""
- callback_url = (code or "").strip()
- if not callback_url.lower().startswith(("http://127.0.0.1", "http://localhost")):
+ raw = (code or "").strip()
+ if not raw:
+ return {"ok": False, "error": "invalid_callback_url"}
+ # Browsers strip the ``http://`` prefix when the user copies
+ # from the address bar in some setups, so accept the bare
+ # ``127.0.0.1:port/...`` shape too — re-add the scheme before
+ # validating so the rest of the flow sees a normal URL.
+ lowered = raw.lower()
+ if not lowered.startswith(("http://", "https://")):
+ raw = "http://" + raw.lstrip("/")
+ lowered = raw.lower()
+ if not (
+ lowered.startswith("http://127.0.0.1")
+ or lowered.startswith("http://localhost")
+ ):
return {"ok": False, "error": "invalid_callback_url"}
+ callback_url = raw
provider_id = flow.provider
if not provider_id:
return {"ok": False, "error": "flow_missing_provider"}