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
fix(remote-access): redact secrets from config payload
cyh0506fc0e2178
diff --git a/tests/test_api_save_config_merge.py b/tests/test_api_save_config_merge.pyindex d62949b97..c22dde5fb 100644--- a/tests/test_api_save_config_merge.py+++ b/tests/test_api_save_config_merge.py@@ -118,6 +118,41 @@ def test_save_config_accepts_typing_ack_mode(monkeypatch, tmp_path):assert updated.ack_mode == "typing"+def test_config_to_payload_redacts_remote_access_secrets_and_save_preserves_them(monkeypatch, tmp_path):+ monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))+ payload = _full_config_payload()+ payload["remote_access"] = {+ "provider": "vibe_cloud",+ "vibe_cloud": {+ "enabled": True,+ "backend_url": "https://vibe.io",+ "public_url": "https://alex.vibe.io",+ "instance_id": "inst_123",+ "client_id": "vr_client_123",+ "issuer": "https://vibe.io",+ "authorization_endpoint": "https://vibe.io/oauth/authorize",+ "token_endpoint": "https://vibe.io/oauth/token",+ "jwks_uri": "https://vibe.io/oauth/jwks.json",+ "redirect_uri": "https://alex.vibe.io/auth/callback",+ "tunnel_token": "tunnel-token",+ "instance_secret": "instance-secret",+ "session_secret": "session-secret",+ },+ }+ created = api.save_config(payload)++ redacted = api.config_to_payload(created)+ cloud_payload = redacted["remote_access"]["vibe_cloud"]+ updated = api.save_config({**redacted, "show_duration": False})++ assert "tunnel_token" not in cloud_payload+ assert "instance_secret" not in cloud_payload+ assert "session_secret" not in cloud_payload+ assert updated.remote_access.vibe_cloud.tunnel_token == "tunnel-token"+ assert updated.remote_access.vibe_cloud.instance_secret == "instance-secret"+ assert updated.remote_access.vibe_cloud.session_secret == "session-secret"++def test_save_config_accepts_slack_disable_link_unfurl(monkeypatch, tmp_path):monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))diff --git a/tests/test_remote_access_vibe_cloud.py b/tests/test_remote_access_vibe_cloud.pyindex ea8f8cf6f..54a1981a6 100644--- a/tests/test_remote_access_vibe_cloud.py+++ b/tests/test_remote_access_vibe_cloud.py@@ -69,11 +69,48 @@ def test_pair_redeems_key_and_starts_connector(monkeypatch, tmp_path) -> None:saved_payload = json.loads((tmp_path / "config" / "config.json").read_text(encoding="utf-8"))assert result["ok"] is True+ assert result["pairing"]["ok"] is True+ assert result["start"]["ok"] is Trueassert saved_payload["remote_access"]["vibe_cloud"]["enabled"] is Trueassert saved_payload["remote_access"]["vibe_cloud"]["tunnel_token"] == "tunnel-token"assert saved_payload["remote_access"]["vibe_cloud"]["session_secret"]+def test_pair_reports_success_when_connector_start_fails(monkeypatch, tmp_path) -> None:+ monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))+ config = _config()+ config.remote_access.vibe_cloud.enabled = False+ config.save()++ monkeypatch.setattr(+ remote_access,+ "_json_request",+ lambda *args, **kwargs: {+ "instance_id": "inst_123",+ "client_id": "vr_client_123",+ "issuer": "https://backend.test",+ "authorization_endpoint": "https://backend.test/oauth/authorize",+ "token_endpoint": "https://backend.test/oauth/token",+ "jwks_uri": "https://backend.test/oauth/jwks.json",+ "public_url": "https://alex.vibe.io",+ "redirect_uri": "https://alex.vibe.io/auth/callback",+ "tunnel_token": "tunnel-token",+ "instance_secret": "instance-secret",+ },+ )+ monkeypatch.setattr(remote_access, "start", lambda next_config: {"ok": False, "error": "cloudflared_spawn_failed"})+ monkeypatch.setattr(remote_access, "status", lambda next_config=None: {"ok": True, "running": False, "paired": True})++ result = remote_access.pair("vrp_test", "https://backend.test")+ saved_payload = json.loads((tmp_path / "config" / "config.json").read_text(encoding="utf-8"))++ assert result["ok"] is True+ assert result["pairing"]["ok"] is True+ assert result["start"]["ok"] is False+ assert result["start"]["error"] == "cloudflared_spawn_failed"+ assert saved_payload["remote_access"]["vibe_cloud"]["tunnel_token"] == "tunnel-token"++def test_pair_returns_structured_error_when_backend_request_fails(monkeypatch) -> None:monkeypatch.setattr(remote_access, "_json_request", lambda *args, **kwargs: (_ for _ in ()).throw(OSError("offline")))diff --git a/vibe/api.py b/vibe/api.pyindex a4d6226d4..35131a6f7 100644--- a/vibe/api.py+++ b/vibe/api.py@@ -287,7 +287,7 @@ def save_config(payload: dict) -> V2Config:base_config: Optional[V2Config] = Nonetry:base_config = load_config()- base_payload = config_to_payload(base_config)+ base_payload = config_to_payload(base_config, include_secrets=True)except FileNotFoundError:base_payload = {}@@ -307,7 +307,15 @@ def save_config(payload: dict) -> V2Config:return config-def config_to_payload(config: V2Config) -> dict:+def _vibe_cloud_payload(config: V2Config, include_secrets: bool) -> dict:+ payload = config.remote_access.vibe_cloud.__dict__.copy()+ if not include_secrets:+ for key in ("tunnel_token", "instance_secret", "session_secret"):+ payload.pop(key, None)+ return payload+++def config_to_payload(config: V2Config, *, include_secrets: bool = False) -> dict:from config.platform_registry import platform_descriptorsplatform_payload = {}@@ -342,7 +350,7 @@ def config_to_payload(config: V2Config) -> dict:"ui": config.ui.__dict__,"remote_access": {"provider": config.remote_access.provider,- "vibe_cloud": config.remote_access.vibe_cloud.__dict__,+ "vibe_cloud": _vibe_cloud_payload(config, include_secrets),},"update": config.update.__dict__,"ack_mode": config.ack_mode,diff --git a/vibe/remote_access.py b/vibe/remote_access.pyindex 8307c18de..35038ec2e 100644--- a/vibe/remote_access.py+++ b/vibe/remote_access.py@@ -346,7 +346,7 @@ def pair(pairing_key: str, backend_url: str, device_name: str = "Vibe Remote") -cloud.session_secret = cloud.session_secret or secrets.token_urlsafe(32)config.save()start_result = start(config)- return {**status(config), "ok": start_result.get("ok", False), "pairing": "ok", "start": start_result}+ return {**status(config), "ok": True, "pairing": {"ok": True}, "start": start_result}def _session_signature(secret: str, payload: str) -> str: