Repository navigation
fix(connectors): connector reliability: slow hosts, setup for every kind, cards that end before the call, stress fixes - #933
Merged
Conversation
…sions rework The 15 connector stress-test bugs (reviews/connector-stress-20261113), ported onto #927 rather than copied over it: - An installed connector that is off, removed, lost its grant, failed to start or failed in transport answers discovery as an empty server with the reason in its instructions, so one broken connector never ends an agent's turn; tool calls and rejected credentials still fail. - Hosted tools name their host; Installed rows and pages read host facts from the whole catalog. - Person-waiting Scient tools are direct-only on Codex; card endings keep their reason. - Copy/save identity guards, thread-owned drafts, multi-word registry search with a cut note, a real start check on restart, readable env-name titles, removed-history sweep, expandable output-only rows, native question publication, discoverable connector tools for Scient Agent. Kept from #927: every agent-tool path still checks the person's agent choice first. Control takes one caller location (project, worktree, agent); copy carries both the owning thread and the agent; the new name guards answer an excluded agent without naming what it may not see. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… cards end before the call The G4 connector failures from analytics (11-12 to 11-14): - Adding a hosted connector gave its MCP handshake a fixed 5 s. One budget now covers the whole handshake (headers, 429/503 waits and the reply body): the 30 s every other control request already has. The caller's cancellation reaches the request, ending the probe's session never holds up the answer, and a timeout says the host may be waking up and to try once more. The Add dialog says "Still connecting" after 4 s. - Connector tool failures reached analytics as `accounts`. AccountsError carries an optional, closed failureClass from the connector's own reason, so an unreachable host reads as `unreachable`, owned by the external host. - scient_connector_setup refused every hosted connector while Scient's own advice sent agents there. Setup now answers for every connector, and one helper gives setup and every next step the same route: setup for a local connector, sign-in control for a sign-in, the person for a hosted key or Source Control account that is gone; a ready one "needs no setup". - Adding by an inexact name now offers up to 3 candidate names this agent may add; it never adds a guess. - A key card waited 10 minutes, but the caller dropped the call first. Scient Agent's bridge hit Bun's own fetch deadline (~300-360 s, "The operation timed out."; reproduced with Bun 1.4.4, which the agent embeds) and Antigravity ends a tool call at 180 s. The bridge now turns Bun's deadline off (its 65-minute signal stays), and cards end before the caller would drop the call: 10 minutes for Scient Agent, 150 s for Antigravity, 4 minutes for every other agent (T3's rule for a silent call). The agent gets a clean timed_out. - Antigravity ended the whole turn when a Scient-run connector died after its session was issued: the next tools/list met HTTP 404. Discovery on such a session now meets the empty server; tool calls still hear the session is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
…e per call Codex review of #933: - A refused credential met the empty server. Only a key bound for a plugin carried "rejected"; a stored or bound key refused with 401, GitHub refusing every Source Control token, and a sign-in the service no longer accepts (refresh refused, or the refreshed token refused) came back as failed or lost, so initialize and tools/list answered success with no tools. Every terminal refusal is now one "rejected" outcome that fails every request, discovery too; a hosted service answering 403 to a credential Scient sent fails it the same way. A connector that is gone, off, or whose host is unreachable still meets the empty server. The connector check reads them as before (a refused sign-in needs sign-in). - Each card got the caller's full wait, so setup asking two keys (or an add asking a client ID and then a secret) could keep Antigravity's call open past 180 s. One allowance is set when the tool call starts; each card gets what is left of it minus 5 s to answer, none opens with under 15 s left, and after a card times out or the run ends under it no further card opens in that call. A client secret card that timed out is no longer read as "no secret". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
This PR changes the test suite by +23 test cases (browser 0, unit +1, server +22). Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing. |
… a refusal Codex re-check of #933: - After the service refused a sign-in (the refresh, or the refreshed token), only the request that saw it failed. The connector then reads needs-sign-in, and the proxy's grant check sent every later request to the empty server, so the next initialize succeeded and tools/list answered no tools. Scient now keeps the refusal (what to tell the agent, never a token) for the credential generation it ended; every later request, discovery too, fails with it until the person signs in again, or turns the connector off or removes it. The grant check now covers only who may use a connector; whether it is signed in is the forward's to answer. - Any 403 to a hosted connector that held a credential failed discovery, an HTML edge-policy page too. A 403 counts as a refused credential only with a WWW-Authenticate challenge or a JSON error naming one (invalid_token, insufficient_scope, invalid_api_key, unauthorized, unauthenticated, authentication_error; at most 16 KiB read). Any other 403 meets the empty server again; tool calls are refused either way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…al back Turning a connector off clears its standing refusal under the lifecycle lock, so a refresh already in flight (which publishes its refusal under that lock) settles first. Found in re-check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ading module OmpRpcProcess now imports ScientAgentToolLoading, so a change to it on main must void a pending OMP publication like the rest of its inputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yaacovcorcos
enabled auto-merge
November 15, 2026 01:55
…ability-20261115 # Conflicts: # apps/server/src/provider/agentContextBudget.scient.json # apps/server/src/telemetry/ScientMcpAnalytics.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #927 and must merge after it. #927 has now merged; this branch is rebased onto
main(no merge commits) and contains only its own four commits.What Changed
Four commits.
1. The 11-13 connector stress-test fixes, ported onto #927's Extensions rework (not copied over it):
instructions. One broken connector no longer ends an agent's turn. Tool calls and refused credentials still fail (see commits 3 and 4).timed_out,declined,cancelled).2. The G4 fixes from the analytics run:
accounts.AccountsErrorhas an optional, closedfailureClasstaken from the connector's own reason, so an unreachable host reportsunreachable, owned byexternal. There is no new event and no message parsing.scient_connector_setuprefused hosted connectors, while Scient's own next-step text sent agents there. Setup now answers for every connector. One helper gives setup and every next step the same route: setup for a local connector, sign-in control for a sign-in, the person for a hosted key or Source Control account that is gone. A ready connector "needs no setup".scient_connector_list {query}step. It never adds a guess.timeout: false; Node ignores it, and its 65-minute signal stays. Card deadlines come from one table next to the person-wait tool list: Scient Agent and Oh My Pi 10 min, Antigravity 150 s, every other agent 4 min (T3's rule for a call that stays silent). On expiry the agent gets a cleantimed_out. Commit 3 makes this one deadline per tool call, not per card.tools/liston that session got HTTP 404 (MCP load failed for ct-crash … HTTP 404). Discovery on a dead session of a Scient-run program now meets the empty server, on both paths: the program's lost session and Scient's dropped proxy session. Tool calls keep the 404, so clients start a new session.3. Codex review fixes:
A refused credential fails discovery. Only a key bound for a plugin was marked as refused. These were reported as
failedorlost, soinitializeandtools/listreturned success with no tools:Each of these is now one
rejectedoutcome, and every request fails on it, discovery too. A hosted 403 counts only with auth evidence (commit 4). A connector that is gone, off or unreachable still answers discovery as an empty server. The connector check reports these as before: a refused sign-in reads as needs sign-in.One card deadline per tool call. Each card got the caller's full wait. So setup asking for two keys, or an add asking for a client ID and then a secret, could keep Antigravity's call open past 180 s. Now one allowance starts with the tool call (
scient_connector_setup,scient_connector_add,scient_account_add). Each card gets what is left minus 5 s to answer. No card opens with less than 15 s left. Once a card times out, or the run ends under it, no further card opens in that call.declined,cancelledandtimed_outstay distinct. A client-secret card that timed out or closed no longer counts as "no secret".4. Codex re-check fixes:
initializesucceeded andtools/listanswered no tools. Scient now keeps the refusal for the credential generation it ended: the message for the agent, never a token, and only in memory. Every later request fails with it, discovery too. It clears when the person signs in again, turns the connector off, or removes it. The grant check now covers only who may use a connector (on, eligible, this project, this agent). Whether it is signed in is decided where the request is forwarded, which already refused anything not connected.WWW-Authenticatechallenge, or a JSON error naming an auth failure:invalid_token,insufficient_scope,invalid_api_key,unauthorized,unauthenticatedorauthentication_error, aserror,code,error_codeorerror.code/type/status. At most 16 KiB of the body is read. Any other 403 answers discovery as an empty server again. Tool calls are refused either way.Why
Analytics for 11-12 to 11-14 (reviews/analytics-failures-20261115, group G4) showed four separate causes:
unreachableadds, which then worked 20–77 s later);accountslabelling;exceptions).Neither #927 nor the 11-13 stress work fixed any of them. The decided design is in ORCHESTRATION.md "G4 — connectors".
Scient Agent cut-off, reproduced with Bun 1.4.4, the version Scient Agent embeds:
fetchfetchrequestTimeout: 0)TimeoutError: The operation timed out.at 360 stimeout: falseProduction saw this at 322–345 s. Scripts and output are in reviews/analytics-failures-20261115/test-G4/timeout-repro.
Tests
Regression tests; each fails without its fix:
ConnectorProbe.test.ts: a server that misses the given budget is told to try again (the literal 5 s ignored the budget). A stalled SSE body is bounded too. Caller cancellation aborts the request. A hanging session DELETE doesn't hold up the answer.ScientMcpAnalytics.test.ts: an unreachable connector failure insideAccountsErrorreportsaccounts/unreachable/external.connectorSetup.test.ts(new): hosted ready gives "needs no setup"; a hosted sign-in namesscient_connector_control; a gone key or Source Control account says to ask the user. No advice for a hosted connector namesscient_connector_setup.ConnectorRuntime.test.ts: an inexact add name returns candidates and adds nothing. A program that dies with its session open keeps discovery answering on both 404 paths, while tool calls still get 404.accountAdd.test.ts: an Antigravity card ends under 180 s; Codex, Claude and unknown agents end under 300 s.OmpScientExtension.test.ts: the bridge's tool call passestimeout: false.ConnectorRuntime.test.ts(commit 3): a stored key the service accepted and then refuses (401 and 403) fails bothinitializeandtools/list. A refused refresh and a refused refreshed token failinitialize. GitHub refusing Source Control's only token failsinitialize.connectorSetup.test.ts(commit 3): on Antigravity, a first key saved after 100 s leaves the second card less than the rest of 150 s. An unanswered first card means no second card opens.Also run, on Node 26.13.1:
pnpm run typecheck,vp fmt --check,vp lint, knip;scient/extensions,scient/accounts,telemetry,provider,mcp/toolkits,scient/skills,scient/storageandCodexAdapterV2(3352 passed). The one failure,provider/Drivers/ClaudeSkills.test.ts(EEXIST on macOS's case-insensitive disk), is in a file this PR doesn't touch;scient/extensions(125), client-runtimework-log(186), contracts (518);scient-seam-check --base origin/mainpasses. Both accounts and OMP manifests now classifyScientPersonWaitTools.ts;verify-upstream-provenancepasses.Agent context budget grows; this is Scient's own text, not T3's:
So I did not add the
agent-context-increaselabel; that's the maintainer's call.ConnectorRuntime.test.ts(commit 4): after a refused refresh and after a refused refreshed token, a secondinitializeand atools/liststill fail; turning the connector off and on again makes it merely unavailable. A stored key refused with a JSONinvalid_api_key403 or with aWWW-Authenticate403 fails discovery. An HTML edge 403 answersinitializeandtools/listas an empty server, still fails the tool call, and the tools return once the block lifts.Commit 3 was rerun on Node 26.13.1: root
pnpm run typecheck, fmt and lint on the changed files,scient/extensions,scient/accounts,ScientPersonWaitTools, OMP extension,ScientMcpAnalyticsandOrchestratorMcpService.activity(94 files, 769 passed), the seam check and provenance. Its six new tests fail on commit 2's code.Commit 4 was rerun on Node 26.13.1: root
pnpm run typecheck, fmt and lint on the changed files, and the server suitesscient/extensions,scient/accounts/agent,provider,telemetryandscient/storage(2621 passed; the one failure is the same unrelatedClaudeSkills.test.tsEEXIST). Also the seam check and provenance. Its new OAuth and edge-403 tests fail with the fix disabled.Live checks in a dev app from this branch (record: reviews/analytics-failures-20261115/test-G4/RECORD.md):
timed_outat 150 s, before its 180 s limit;Not run live: Scient Agent's key card, and commits 3 and 4 (refused-credential discovery and the shared deadline are covered by the tests above). The dev profile had no Scient Agent model sign-in (only Antigravity's was approved for copying), and a local Ollama model rejected Scient Agent's tool schemas. The cause and the
timeout: falsefix were checked at the transport level, as described above.Documentation Impact
Documentation impact: Updated —
docs/internals/scient-extensions.md(from the ported stress fixes). The three connector-authoring skill copies are updated by the port.Platforms
.cmd), so the dead-session fix matters most here.timeout: falsewere not checked on Windows (same Bun build family).UI Changes
The Add dialog shows "Still connecting. A hosted server can take up to 30 seconds to wake up." after 4 s of adding. Connector pages show a Host row (from the ported stress fixes).
🤖 Generated with Claude Code