Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

providers.md

109 lines7.1 KB

1# Provider constraints
2​
3Orchestration records intent and state without knowing which provider runs a thread. Provider
4protocols, account ownership, permissions, and capabilities belong at the
5[adapter boundary](../../apps/server/src/provider/Services/ProviderAdapter.ts). Normalize there
6instead of spreading provider checks through reactors and clients.
7​
8A driver kind identifies an integration; an instance identifies one configuration and account
9lifecycle. Route work by instance, so two accounts using the same driver do not share mutable
10session or catalog state.
11​
12## Process and account isolation
13​
14T3-managed OpenCode chat uses one server per thread. Its MCP registrations are directory-scoped, while
15T3's MCP connection is thread-scoped. Sharing a chat server between threads in one directory would
16let them replace each other's connection. Catalog and text-generation work can share the
17[instance-owned helper](../../apps/server/src/provider/OpenCodeServerOwner.ts), which closes
18after an idle period. External OpenCode servers remain externally owned and can require an
19external restart to pick up configuration changes.
20​
21OpenCode also stores persistent approval grants per directory. Automatic full-access replies use
22`once` so they cannot widen a supervised thread's permissions on a shared external server.
23See the [adapter](../../apps/server/src/provider/Layers/OpenCodeAdapter.ts).
24​
25Antigravity separates account profiles per instance while sharing installed executables across the
26environment. It forces file-based credential storage because the native macOS keychain entry would
27otherwise be shared across instances. The launch environment removes ambient Google credentials,
28so an instance cannot silently use another account or billing project. The agent also resolves
29its user-global skill directories under that profile, so the profile links those two directories
30back to the user's real `~/.gemini`; MCP servers, hooks, and rules there stay out of the profile.
31See [profile isolation](../../apps/server/src/provider/antigravityAuthSupport.ts).
32​
33The [Antigravity installer](../../apps/server/src/provider/AntigravityInstallation.ts) outlives
34client connections and provider-instance rebuilds. Releases are immutable, with an atomic pointer
35selecting the version for new processes. Running processes hold leases on their version. Updates
36and removal must respect those leases instead of replacing executables under a running agent.
37​
38## Setup must not happen as a health-check side effect
39​
40Opening a provider session can start MCP servers, run hooks, or launch a login browser.
41[Grok probes](../../apps/server/src/provider/Layers/GrokProvider.ts) avoid authentication and
42session creation for this reason. Antigravity likewise reserves authenticated catalog sessions for
43explicit setup or model refresh; background checks use initialization only.
44​
45[Antigravity sign-in](../../apps/server/src/provider/AntigravityAuth.ts) belongs to the initiating
46T3 auth session. The client carries the return URL back to the environment because the provider's
47loopback listener may be on another machine. Forward only the callback for the owned pending flow;
48a successful callback HTTP request is not proof that provider authentication finished. The native
49process owns token exchange and storage.
50​
51Antigravity sign-out closes admission to new processes and stops existing processes before clearing account
52metadata. Otherwise a helper or resumed session could retain the old account. Cached model lists
53do not establish current access, and an authoritative empty catalog must clear the old list.
54​
55Antigravity text-generation helpers deny tool requests, but native hooks and MCP configuration can
56run before the prompt. They reject profiles with such configuration before launch. Prompt
57instructions and tool denial do not create a native sandbox.
58See [helper constraints](../../apps/server/src/textGeneration/AntigravityTextGeneration.ts).
59​
60## Provider updates run only through the owning installer
61​
62A one-click update is offered only when the resolved executable's path proves which installer owns
63it. Homebrew and npm are proven by the real path (symlinks followed): a versioned keg or cask under
64`brew --prefix`, or `<prefix>/lib/node_modules/<pkg>/` (Windows: the shim beside `node_modules`).
65Native installer layouts and the global bin directories of pnpm, Bun, and Vite+ may match on either
66the resolved path or its real target, since those installers place real files or their own symlinks
67there. Anything unproven stays manual-only but still reports the version gap. npm updates pin
68`--prefix` because the `npm` on `PATH` can belong to a different Node than the one that owns the
69provider. Homebrew
70compares against `brew info` since casks trail npm by hours; native installs share npm's version
71train, so the registry stays authoritative for them.
72See the [resolver](../../apps/server/src/provider/providerMaintenance.ts).
73​
74Ownership is cached per instance and re-read immediately before an update runs. The
75[runner](../../apps/server/src/provider/providerMaintenanceRunner.ts) refuses when the lock key
76changed since the advisory, and reports success only when the refreshed provider is still installed
77with a readable, current version.
78​
79## Protocol traps
80​
81Codex async questions arrive as notifications and are answered with a new user message. There is
82no pending RPC response to send. Blocking questions still use the request/response path. The
83[adapter](../../apps/server/src/provider/Layers/CodexAdapter.ts) distinguishes them; the
84[decider](../../apps/server/src/orchestration/decider.ts) records an async answer and its user
85message together.
86​
87An async question can outlive the turn or a server restart. The engine reads that request's
88durable activity before resolving it because the in-memory command snapshot omits old activities.
89Do not infer that a request has disappeared merely because it is outside the recent window.
90​
91Capabilities must describe what the provider can actually do. Antigravity can capture workspace
92checkpoints but cannot roll back its conversation. The [checkpoint boundary](./overview.md#turn-completion-and-checkpoints)
93therefore rejects revert before touching files. Native permission and question option IDs must
94also survive normalization; a display label is not necessarily a valid reply.
95​
96## Attachments and stored history
97​
98Attachments live outside the project workspace. [ProviderService](../../apps/server/src/provider/Layers/ProviderService.ts)
99puts their environment-local paths in turn input and lets adapters choose native input formats.
100A path in the prompt does not grant filesystem access. Keep provider sandbox and approval rules
101in force; copying uploads into the project to bypass them changes that boundary.
102​
103File attachments introduced a replay compatibility limit. Image-only clients cannot decode
104file-bearing messages, and an image-only server can fail the entire environment's startup when
105replaying one such event. Rollouts and downgrades must account for persisted history as well as
106current client support.
107​
108Model classification has its own [manifest constraints](./model-manifest.md). Assistant-reference
109handling is documented under [citations](./assistant-citations.md).