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

providers.md

88 lines5.6 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.
29See [profile isolation](../../apps/server/src/provider/antigravityAuthSupport.ts).
30​
31The [Antigravity installer](../../apps/server/src/provider/AntigravityInstallation.ts) outlives
32client connections and provider-instance rebuilds. Releases are immutable, with an atomic pointer
33selecting the version for new processes. Running processes hold leases on their version. Updates
34and removal must respect those leases instead of replacing executables under a running agent.
35​
36## Setup must not happen as a health-check side effect
37​
38Opening a provider session can start MCP servers, run hooks, or launch a login browser.
39[Grok probes](../../apps/server/src/provider/Layers/GrokProvider.ts) avoid authentication and
40session creation for this reason. Antigravity likewise reserves authenticated catalog sessions for
41explicit setup or model refresh; background checks use initialization only.
42​
43[Antigravity sign-in](../../apps/server/src/provider/AntigravityAuth.ts) belongs to the initiating
44T3 auth session. The client carries the return URL back to the environment because the provider's
45loopback listener may be on another machine. Forward only the callback for the owned pending flow;
46a successful callback HTTP request is not proof that provider authentication finished. The native
47process owns token exchange and storage.
48​
49Antigravity sign-out closes admission to new processes and stops existing processes before clearing account
50metadata. Otherwise a helper or resumed session could retain the old account. Cached model lists
51do not establish current access, and an authoritative empty catalog must clear the old list.
52​
53Antigravity text-generation helpers deny tool requests, but native hooks and MCP configuration can
54run before the prompt. They reject profiles with such configuration before launch. Prompt
55instructions and tool denial do not create a native sandbox.
56See [helper constraints](../../apps/server/src/textGeneration/AntigravityTextGeneration.ts).
57​
58## Protocol traps
59​
60Codex async questions arrive as notifications and are answered with a new user message. There is
61no pending RPC response to send. Blocking questions still use the request/response path. The
62[adapter](../../apps/server/src/provider/Layers/CodexAdapter.ts) distinguishes them; the
63[decider](../../apps/server/src/orchestration/decider.ts) records an async answer and its user
64message together.
65​
66An async question can outlive the turn or a server restart. The engine reads that request's
67durable activity before resolving it because the in-memory command snapshot omits old activities.
68Do not infer that a request has disappeared merely because it is outside the recent window.
69​
70Capabilities must describe what the provider can actually do. Antigravity can capture workspace
71checkpoints but cannot roll back its conversation. The [checkpoint boundary](./overview.md#turn-completion-and-checkpoints)
72therefore rejects revert before touching files. Native permission and question option IDs must
73also survive normalization; a display label is not necessarily a valid reply.
74​
75## Attachments and stored history
76​
77Attachments live outside the project workspace. [ProviderService](../../apps/server/src/provider/Layers/ProviderService.ts)
78puts their environment-local paths in turn input and lets adapters choose native input formats.
79A path in the prompt does not grant filesystem access. Keep provider sandbox and approval rules
80in force; copying uploads into the project to bypass them changes that boundary.
81​
82File attachments introduced a replay compatibility limit. Image-only clients cannot decode
83file-bearing messages, and an image-only server can fail the entire environment's startup when
84replaying one such event. Rollouts and downgrades must account for persisted history as well as
85current client support.
86​
87Model classification has its own [manifest constraints](./model-manifest.md). Assistant-reference
88handling is documented under [citations](./assistant-citations.md).