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.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
merge(org): sync pinned integration into org
Max36d99a2910af
diff --cc tests/test_instance_authorization.pyindex 2b63f37f7,bd3422e15..7a479b624--- a/tests/test_instance_authorization.py+++ b/tests/test_instance_authorization.py@@@ -238,11 -188,18 +238,19 @@@ def test_remote_http_policy_defaults_lo("method", "path", "expected"),[("GET", "/api/projects", REMOTE_HTTP_ALLOWED),+ ("POST", "/api/sessions/ses-1/messages", REMOTE_HTTP_ALLOWED),- ("PUT", "/api/workbench/prefs", REMOTE_HTTP_ALLOWED),+ ("GET", "/api/workbench/prefs", REMOTE_HTTP_ALLOWED),+ ("PUT", "/api/workbench/prefs", REMOTE_HTTP_LOCAL_ONLY),("PUT", "/api/resource-policies/agent/agent-1", REMOTE_HTTP_ALLOWED),- ("GET", "/api/models/runtime/status", REMOTE_HTTP_ALLOWED),+ ("GET", "/api/models/runtime/status", REMOTE_HTTP_LOCAL_ONLY),("GET", "/api/models/agents/codex/chain", REMOTE_HTTP_ALLOWED),+ ("GET", "/api/models/turns/turn-1/provenance", REMOTE_HTTP_ALLOWED),+ # Only the local owner can start an OAuth flow, and a status poll hands+ # back that flow's authorization URL and device code - plus, once a Model+ # Hub flow succeeds, the credential and account payload `/api/models/+ # sources` keeps local. Polling follows its flow and stays local too.+ ("GET", "/api/models/oauth/status/oaf_test0001", REMOTE_HTTP_LOCAL_ONLY),+ ("GET", "/api/backend/codex/auth/oauth/status/flow-1", REMOTE_HTTP_LOCAL_ONLY),("GET", "/api/backend/codex/runtime", REMOTE_HTTP_LOCAL_ONLY),("GET", "/api/opencode/permission-status", REMOTE_HTTP_LOCAL_ONLY),("GET", "/api/vault/audit", REMOTE_HTTP_ALLOWED),diff --cc tests/test_resource_acl_show_pages.pyindex 6dcbb48c2,f99ce2ee8..4e55cd491--- a/tests/test_resource_acl_show_pages.py+++ b/tests/test_resource_acl_show_pages.py@@@ -217,6 -147,6 +217,7 @@@ def test_remote_show_page_list_and_dire"/show/ses-private/",base_url="https://alex.avibe.bot",environ_base=_remote_peer(),++ headers={"Accept": "text/html"},follow_redirects=False,)@@@ -224,17 -154,8 +225,18 @@@assert {item["session_id"] for item in catalog.get_json()["pages"]} == {"ses-public", "ses-scope"}assert all("path" not in item for item in catalog.get_json()["pages"])assert mutation.status_code == 403- assert mutation.get_json()["code"] == "remote_execution_disabled"- assert page.status_code == 403+ assert mutation.get_json()["code"] == "resource_access_forbidden"+ assert page.status_code == 302+ assert "show_page_id=ses-private" in page.headers["Location"]++ reauth_result = client.get(+ "/show/ses-private/?__vibe_show_page_reauth=1",+ base_url="https://alex.avibe.bot",+ environ_base=_remote_peer(),++ headers={"Accept": "text/html"},+ follow_redirects=False,+ )+ assert reauth_result.status_code == 403def test_remote_show_page_creation_defaults_private_and_org_public_does_not_share(monkeypatch, tmp_path) -> None:diff --cc tests/test_ui_remote_access_auth.pyindex f2e2668a2,68e47734a..83d16ee9c--- a/tests/test_ui_remote_access_auth.py+++ b/tests/test_ui_remote_access_auth.py@@@ -13,6 -13,6 +13,7 @@@ import pytesfrom config.v2_config import AgentsConfig, PlatformsConfig, RemoteAccessConfig, RuntimeConfig, SlackConfig, UiConfig, V2Configfrom config.v2_config import CONFIG_LOCK++from storage.importer import ensure_sqlite_statefrom tests.ui_server_test_helpers import csrf_headers, remote_session_cookiefrom vibe import apifrom vibe import remote_access@@@ -166,202 -167,6 +168,235 @@@ def test_remote_login_endpoint_redirectassert state_payload["retry"] is False+def test_private_show_page_login_freezes_target_in_authorize_and_handshake(+ monkeypatch, tmp_path+):+ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))+ config = _save_config(tmp_path)+ client = app.test_client()++ navigation = client.get(+ "/show/session-one/",+ base_url="https://alex.avibe.bot",+ environ_base=_remote_peer(),+ headers={"Accept": "text/html"},+ follow_redirects=False,+ )++ assert navigation.status_code == 302+ assert navigation.headers["Location"] == "/auth/login?next=%2Fshow%2Fsession-one%2F"++ login = client.get(+ navigation.headers["Location"],+ base_url="https://alex.avibe.bot",+ environ_base=_remote_peer(),+ follow_redirects=False,+ )++ assert login.status_code == 302+ authorize_params = httpx.URL(login.headers["Location"]).params+ assert authorize_params["show_page_id"] == "session-one"+ state_payload = ui_server._read_oauth_state(+ config.remote_access.vibe_cloud.session_secret,+ authorize_params["state"],+ )+ assert state_payload is not None+ stored = remote_access._oauth_handshakes[state_payload["r"]]+ assert stored["show_page_id"] == "session-one"++ asset = client.get(+ "/show/session-one/asset.js",+ base_url="https://alex.avibe.bot",+ environ_base=_remote_peer(),+ follow_redirects=False,+ )+ assert asset.status_code == 401+ assert asset.get_json()["error"] == "remote_access_login_required"++++def test_private_show_page_asset_xhr_gets_401_instead_of_show_page_oauth(++ monkeypatch, tmp_path++):++ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))++ config = _save_config(tmp_path)++ ensure_sqlite_state()++ client = app.test_client()++ client.set_cookie(++ remote_access.SESSION_COOKIE_NAME,++ remote_session_cookie(++ config,++ "[email protected]",++ "guest-1",++ role="viewer",++ access_source="email",++ ),++ domain="alex.avibe.bot",++ )++++ response = client.get(++ "/show/session-one/asset.js",++ base_url="https://alex.avibe.bot",++ environ_base=_remote_peer(),++ headers={"Accept": "application/javascript"},++ follow_redirects=False,++ )++++ assert response.status_code == 401++ assert response.get_json()["error"] == "remote_access_login_required"+++++def test_existing_broader_session_reauthorization_stops_when_grant_is_missing(+ monkeypatch,+ tmp_path,+):+ from core.show_pages import ShowPageStore++ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))+ config = _save_config(tmp_path)+ store = ShowPageStore()+ try:+ store.ensure("session-one")+ finally:+ store.close()+ client = app.test_client()+ client.set_cookie(+ remote_access.SESSION_COOKIE_NAME,+ remote_session_cookie(+ config,+ "[email protected]",+ "guest-1",+ role="editor",+ access_source="email",+ ),+ domain="alex.avibe.bot",+ )++ start = client.get(+ "/show/session-one/__show/me",+ base_url="https://alex.avibe.bot",+ environ_base=_remote_peer(),++ headers={"Accept": "text/html"},+ follow_redirects=False,+ )+ authorize_params = httpx.URL(start.headers["Location"]).params+ state = authorize_params["state"]+ state_payload = ui_server._read_oauth_state(+ config.remote_access.vibe_cloud.session_secret,+ state,+ )+ assert state_payload is not None+ nonce = remote_access._oauth_handshakes[state_payload["r"]]["nonce"]+ monkeypatch.setattr(+ remote_access,+ "exchange_oauth_code",+ lambda *args, **kwargs: {+ "claims": {+ "email": "[email protected]",+ "sub": "guest-1",+ "nonce": nonce,+ },+ "session_claims": {+ "vibe_instance_id": "inst_123",+ "vibe_instance_role": "editor",+ "vibe_instance_access_source": "email",+ },+ },+ )++ callback = client.get(+ f"/auth/callback?code=test-code&state={state}",+ base_url="https://alex.avibe.bot",+ environ_base=_remote_peer(),+ follow_redirects=False,+ )+ assert callback.status_code == 302+ assert ui_server.REMOTE_SHOW_PAGE_REAUTH_PARAM in callback.headers["Location"]++ denied = client.get(+ callback.headers["Location"],+ base_url="https://alex.avibe.bot",+ environ_base=_remote_peer(),+ follow_redirects=False,+ )- assert denied.status_code == 404++ assert denied.status_code == 401++ assert denied.get_json()["error"] == "remote_access_login_required"+ assert "Location" not in denied.headers+++def test_show_page_email_session_is_confined_to_its_signed_route(monkeypatch, tmp_path):+ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))+ config = _save_config(tmp_path)+ cookie = remote_access.make_session_cookie(+ config,+ "[email protected]",+ "guest-1",+ session_claims={+ "vibe_instance_id": "inst_123",+ "vibe_instance_role": "viewer",+ "vibe_instance_access_source": "show_page_email",+ "vibe_show_page_id": "session-one",+ },+ )+ client = app.test_client()+ client.set_cookie(+ remote_access.SESSION_COOKIE_NAME,+ cookie,+ domain="alex.avibe.bot",+ )++ exact = client.get(+ "/show/session-one/missing.js",+ base_url="https://alex.avibe.bot",+ environ_base=_remote_peer(),+ )+ other = client.get(+ "/show/session-two/",+ base_url="https://alex.avibe.bot",+ environ_base=_remote_peer(),+ )+ workbench = client.get(+ "/api/show-pages",+ base_url="https://alex.avibe.bot",+ environ_base=_remote_peer(),+ )+ session_api = client.get(+ "/api/session",+ base_url="https://alex.avibe.bot",+ environ_base=_remote_peer(),+ )++ assert exact.status_code != 403+ assert other.status_code == 403+ assert other.get_json()["error"] == "show_page_access_forbidden"+ assert workbench.status_code == 403+ assert session_api.status_code == 403+++def test_show_page_oidc_claim_shape_fails_closed(monkeypatch, tmp_path):+ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))+ config = _save_config(tmp_path)+ base = {+ "vibe_instance_id": "inst_123",+ "vibe_instance_role": "viewer",+ "vibe_instance_access_source": "show_page_email",+ }++ with pytest.raises(remote_access.OAuthCodeExchangeError, match="invalid_show_page_id"):+ remote_access.session_claims_from_oidc(config, base)+ broader = remote_access.session_claims_from_oidc(+ config,+ {+ **base,+ "vibe_instance_role": "editor",+ "vibe_instance_access_source": "email",+ "vibe_show_page_id": "session-one",+ },+ )+ assert broader["vibe_instance_access_source"] == "email"+ assert broader["vibe_instance_role"] == "editor"+ assert broader["vibe_show_page_id"] == "session-one"++def test_remote_login_endpoint_sanitizes_external_next_target(monkeypatch, tmp_path):monkeypatch.setenv("AVIBE_HOME", str(tmp_path))config = _save_config(tmp_path)diff --cc vibe/authorization.pyindex db3534fca,dd91d4ff0..1adcbf8a3--- a/vibe/authorization.py+++ b/vibe/authorization.py@@@ -440,15 -415,26 +445,30 @@@ _REMOTE_OWNER_ALLOWED_HTTP_RULES = tuplfrozenset({"POST"}),r"^/api/show-pages/[^/]+/ensure$",),+ (+ frozenset({"GET", "HEAD", "PUT"}),+ r"^/api/show-pages/[^/]+/authorized-emails$",+ ),+ # Reading the Dock is safe, but its pins/order and the Workbench prefs+ # are one process-global record shared by the local owner and every+ # remote principal. Until they are keyed by the authenticated subject a+ # remote write would reorder and re-pin everyone else's Dock and flip+ # another principal's banner preference, so the mutations stay local.(frozenset({"GET", "HEAD"}), r"^/api/dock$"),- (frozenset({"POST"}), r"^/api/dock/pins$"),- (frozenset({"DELETE"}), r"^/api/dock/pins/[^/]+$"),- (frozenset({"PUT"}), r"^/api/dock/order$"),- (frozenset({"PUT"}), r"^/api/workbench/prefs$"),+ # Reading push status stays remote, and so does the `POST` form of it:+ # it reports this principal's own subscription count and can only+ # re-attach a device id to an endpoint that is already stored and+ # enabled for that same principal, so it can neither introduce an+ # endpoint nor send to one.+ #+ # Registering and testing a subscription are different: the endpoint is+ # caller-supplied data that `send_web_push()` later fetches from the+ # Avibe host, and nothing between the payload and the request restricts+ # it to a real push service. A remote caller could register an HTTPS+ # endpoint aimed at loopback, a private LAN host or a rebinding name and+ # then have this host issue the request from inside the network, so the+ # write and the test stay local until the endpoint is checked against+ # its resolved addresses.(frozenset({"GET", "HEAD"}),r"^/api/web-push/(?:status|vapid-public-key)$",diff --cc vibe/ui_server.pyindex e4628822c,7b8a99b86..028adf88e--- a/vibe/ui_server.py+++ b/vibe/ui_server.py@@@ -2289,22 -2250,7 +2299,26 @@@ def enforce_remote_access_cookie()return _auth_rate_limit_response()return _redirect_to_vibe_cloud_login(config)return jsonify({"ok": False, "error": "remote_access_authorization_refresh_required"}), 401- g.authorization_context = context_from_session_payload(payload)+ context = context_from_session_payload(payload)+ if request.method == "GET" and context.instance_access_source != "show_page_email":+ show_page_id = _show_page_id_from_private_route(request.path)+ if show_page_id is not None:+ resource_allowed = context.can_use_show_page(+ show_page_id+ ) or _show_page_resource_access_allowed(context, show_page_id)+ reauth_attempted = request.args.get(REMOTE_SHOW_PAGE_REAUTH_PARAM) == "1"++ wants_html = "text/html" in request.headers.get("Accept", "")+ raw_next = request.full_path if request.query_string else request.path- if reauth_attempted and resource_allowed:++ if reauth_attempted and resource_allowed and wants_html:+ return redirect(_strip_show_page_reauth_param(raw_next))- if not reauth_attempted and not resource_allowed:- if _auth_rate_limited():- return _auth_rate_limit_response()- return _redirect_to_vibe_cloud_login(config, show_page_reauth=True)++ if not resource_allowed:++ if not wants_html:++ return jsonify({"ok": False, "error": "remote_access_login_required"}), 401++ if not reauth_attempted:++ if _auth_rate_limited():++ return _auth_rate_limit_response()++ return _redirect_to_vibe_cloud_login(config, show_page_reauth=True)+ g.authorization_context = contextg.remote_session_payload = payloadg.remote_authorization_refresh_at = remote_access.session_authorization_refresh_deadline(payload)if remote_access.session_needs_renewal(payload):@@@ -6030,9 -5899,11 +6075,11 @@@ def cloud_management_auth_callback()else "cloud_management_unavailable")response = _cloud_management_redirect(- "/admin/organization/overview",+ failure_next_path,code,)+ if not owns_flow:+ return responsecloud_management.invalidate_grant(request.cookies.get(cloud_management.HANDLE_COOKIE_NAME))