Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

feat(os): signed out, gateway services stay listed and say Needs harness login

bubu-dudube75463b911b
diff --git a/os/connectors/README.md b/os/connectors/README.md
index 66672d92a..7f517762c 100644
--- a/os/connectors/README.md
+++ b/os/connectors/README.md
@@ -22,8 +22,8 @@ harness connections call github GET https://api.github.com/user
The list is the Grid app's: the connector gateway's `GET /v1/grid/connectors`.
Signed in (`harness login`), the page follows that live list; signed out or
-offline it shows the bundled snapshot, `catalog.json`, limited to the services
-this computer signs in to by itself. `os/tools/update-connector-catalog.py`
+offline it shows the bundled snapshot, `catalog.json`; signed out, the services
+that need the gateway wait for `harness login`. `os/tools/update-connector-catalog.py`
rebuilds the snapshot and its icons from the gateway. Codes are Grid's; a
connection saved under an earlier code (`apollo`, `supermetrics_marketing`) is
read under Grid's (`apollo_io`, `supermetrics`).
@@ -52,8 +52,8 @@ out, the page says so instead of offering Connect. A service the gateway does
not offer to this account shows "Not available yet".
GitHub, Slack, Asana, HubSpot, Gmail, Google Calendar, Google Drive, Figma
-(`figma-api-app`). Signed out, these are not listed; the page says
-`harness login` shows them.
+(`figma-api-app`). Signed out, they are listed with their Connect button
+disabled and "Needs harness login".
**Add custom** takes any remote MCP server URL: one that asks for sign-in uses the
`dcr` path, one with static headers (a personal token) is saved as given.
diff --git a/os/connectors/connections.py b/os/connectors/connections.py
index 9846f4f10..dac3d5e65 100644
--- a/os/connectors/connections.py
+++ b/os/connectors/connections.py
@@ -54,12 +54,12 @@ def custom_code(name, taken):
def services(offered=None):
"""{code: item} the page offers. Signed in, the gateway's live list (the Grid
app's); otherwise the bundled snapshot. A service either list says can sign in
- from this computer does so; one that needs the gateway is shown only when the
- gateway offers it, or when it cannot be asked (offline)."""
- signed_in = gateway.session() is not None
+ from this computer does so. One that needs the gateway is left out only when
+ the gateway, asked, does not offer it; signed out it is shown, waiting for
+ harness login."""
items = {}
for code, item in store.CATALOG.items():
- if item["auth"] == "dcr" or (signed_in and not offered):
+ if item["auth"] == "dcr" or not offered:
items[code] = dict(item)
for code, row in (offered or {}).items():
auth, url = row.get("auth_type"), row.get("mcp_url") or ""
@@ -146,11 +146,13 @@ def catalog(vault, offered=None):
"""The page's cards: every service, connected first, then custom servers."""
tokens = vault.tokens()
known = services(offered)
+ signed_in = gateway.session() is not None
items = []
for code, item in known.items():
card = vault.status(code, tokens.get(code) or {})
card.update(name=item["label"], description=item["description"], auth=item["auth"], custom=False,
- icon="/icons/" + ICONS[code] if code in ICONS else "")
+ icon="/icons/" + ICONS[code] if code in ICONS else "",
+ reason="" if item["auth"] == "dcr" or signed_in else "Needs harness login")
items.append(card)
for code, token in tokens.items():
if code in known:
@@ -162,7 +164,7 @@ def catalog(vault, offered=None):
auth="custom" if custom else token.get("source", "dcr"), custom=custom,
icon="/icons/" + ICONS[code] if code in ICONS else "")
items.append(card)
- return {"connections": items, "signed_in": gateway.session() is not None}
+ return {"connections": items, "signed_in": signed_in}
class PageServer(ThreadingHTTPServer):
diff --git a/os/connectors/web/index.html b/os/connectors/web/index.html
index 7b12c8e02..1b9ae36d7 100644
--- a/os/connectors/web/index.html
+++ b/os/connectors/web/index.html
@@ -20,7 +20,7 @@
<button id="browse" class="pill selected" type="button" role="tab" aria-selected="true">Browse</button>
<button id="connected" class="pill" type="button" role="tab" aria-selected="false">Connected</button>
</div>
- <p id="signed-out" class="hint-line" hidden>GitHub, Slack, Google and a few more sign in through your Harness account. Run <code>harness login</code>, then refresh to see them.</p>
+ <p id="signed-out" class="hint-line" hidden>GitHub, Slack, Google and a few more sign in through your Harness account. Run <code>harness login</code>, then refresh to connect them.</p>
<p id="notice" role="status" aria-live="polite"></p>
<div id="sections"><p class="empty">Loading connectors…</p></div>
<footer>Accounts stay on this computer and are shared by every agent you run here. Disconnecting stops Harness from using an account; revoke it in the service's settings to remove it everywhere.</footer>
diff --git a/os/connectors/web/page.js b/os/connectors/web/page.js
index 275dc2cb8..435d6575b 100644
--- a/os/connectors/web/page.js
+++ b/os/connectors/web/page.js
@@ -51,6 +51,12 @@ function card(item) {
} else if (item.state !== "not_connected") {
if (item.state === "reconnect" && !item.custom) actions.append(button("Reconnect", () => connect(item)));
actions.append(button("×", () => confirmDisconnect(item), "icon", "Disconnect " + item.name));
+ } else if (item.reason) {
+ // Signs in through the Harness account: shown, but not yet connectable.
+ actions.append(node("span", item.reason, "hint"));
+ const add = button("+", () => {}, "icon plus", item.reason);
+ add.disabled = true;
+ actions.append(add);
} else {
actions.append(button("+", () => connect(item), "icon plus", "Connect " + item.name));
}
diff --git a/os/connectors/web/style.css b/os/connectors/web/style.css
index 648cfabcd..f4c59b883 100644
--- a/os/connectors/web/style.css
+++ b/os/connectors/web/style.css
@@ -9,6 +9,7 @@ h1{font-size:26px;font-weight:700;margin:0 0 4px}.intro{margin:0;color:#a3a3a3}
button,input,textarea{font:inherit}
button{min-height:36px;border-radius:8px;border:1px solid #333;background:#1f1f1f;color:inherit;padding:6px 14px;cursor:pointer;white-space:nowrap}
button:hover{border-color:#5b6bff}button:disabled{opacity:.5;cursor:wait}
+.plus:disabled{opacity:.35;cursor:not-allowed;border-color:#1d2450}
button:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid #6b7bff;outline-offset:2px}
.primary{background:#2f45d8;border-color:#3d55ff;color:#fff;font-weight:600}.primary:hover{background:#3a51ea}
.danger{background:#5c1f1f;border-color:#8a2c2c;color:#fff}
diff --git a/os/tests/test_connections.py b/os/tests/test_connections.py
index 827e89610..6f880b390 100644
--- a/os/tests/test_connections.py
+++ b/os/tests/test_connections.py
@@ -379,17 +379,16 @@ class ConnectorGateway(Case):
self.assertIsNone(self.vault.token("github"))
self.assertEqual(server.calls[-1], ("connectors/disconnect", {"connector": "github"}))
- def test_signed_out_the_page_offers_only_what_this_computer_signs_in_to(self):
+ def test_signed_out_the_gateway_services_wait_for_harness_login(self):
self.gateway(signed_in=False)
page = connections.catalog(self.vault)
cards = {c["connector"]: c for c in page["connections"]}
self.assertFalse(page["signed_in"])
- self.assertNotIn("github", cards)
- self.assertNotIn("slack", cards)
- self.assertEqual(cards["linear"]["auth"], "dcr")
- self.assertEqual({c["auth"] for c in page["connections"]}, {"dcr"})
+ for code in ("github", "gmail", "google_calendar", "google_drive"):
+ self.assertEqual(cards[code]["reason"], "Needs harness login", code)
+ self.assertEqual((cards["linear"]["auth"], cards["linear"]["reason"]), ("dcr", ""))
with self.assertRaisesRegex(store.StoreError, "harness login"):
- connections.sign_in_for(self.vault, "slack")
+ connections.sign_in_for(self.vault, "slack").prepare()
def test_signed_in_the_page_follows_the_gateway_and_still_prefers_this_computer(self):
self.gateway()