Repository navigation
[3824 by Claude Opus 5.5] Extension Library: URL MCP servers with stateful sessions and OAuth on remote runtimes, verified live - #3826
Conversation
URL MCP servers now work with both stateless and stateful upstreams, and with no auth, Bearer or OAuth. The Fly smoke workflow now checks all four server types. I have not run the smoke: I don't have the Fly or Sprites credentials here. So the PR description doesn't yet have the run links, per-server modes or refresh counts the issue asks for. Someone needs to dispatch `fly-e2e.yml` with `extensions` checked, once with `agent_runtime=sprites` and once with `fly-machines`, and paste the step summaries. What's verified - Live, from this container: using the new transport against the real public servers: - The mcptest echo server is stateful: a call in a session returned `URL-STATEFUL-OK-…` exactly, and the session was deleted at the end. - DeepWiki is stateless; Microsoft Learn and the mcptest Bearer server are stateful. - A wrong Bearer token is refused in about 110 ms, not a hang. - Unit tests (new): each item on the issue's acceptance list has a test in `packages/core/test/extensionUpstreamSessions.test.ts`, plus one in `extensionOAuth.test.ts` for a stateful OAuth server through a refresh and a 401. One test runs over a real TLS connection, covering event streams and a server that loses sessions on a new connection. - OAuth fixture: a test runs the new fixture against ProPR's own OAuth client and gateway: sign-in, a refresh during an open session, and the DELETE at the end. - Existing suites: the extension, task-history, OpenAPI, Settings and browser tests pass, and lint and typecheck are clean. I didn't run the full repository suite. Gateway sessions (`packages/core/src/extensions/mcpUpstreamSessions.ts`, plus changes in `mcpGateway.ts` and `endpointPolicy.ts`) - The gateway runs `initialize` itself and keeps the session id inside ProPR, per run and server. It never reaches the agent and is hidden in tool output like a credential. - If a server refuses `initialize`, the gateway tries the stateless 2026 protocol. The mode comes from the server's answers, not from configuration. - Each session keeps one connection open to the address checked when it opened. - A lost session (404) is opened again once and the call repeated for `read` servers. A `write` server's call fails instead. - Requests from a server to the agent (sampling and similar) get an error reply and are never passed on. - When a run's access ends or expires, the API deletes its sessions within about 15 seconds. Sessions are capped (8 per run, 256 per API process) and expire after 10 idle minutes. - Existing limits are unchanged: tool allowlist, read/write checks, network policy, byte accounting and token redaction. Behaviour changes - A run's first call to a URL server now makes two extra upstream requests (`initialize` and the initialized notification). Three existing tests that counted requests were updated. - To let the smoke sign in without a browser, the OAuth "start" endpoint now saves the session it is bound to. An API client using a bearer token and a cookie jar therefore gets a session cookie. That cookie doesn't sign anyone in: the callback still requires the same user. - Sessions live in the API process's memory, so restarting it ends them and the next call opens a new one. Settings and docs - After "Test connections", each server shows whether it is stateful or stateless and which authentication it uses, for example "reachable (stateful session, Bearer token)". - "Discover tools" now works on stateful servers too. - The "intentionally unsupported" note in the docs is replaced with the new behaviour and its limits. - Previews are attached. Smoke workflow (`fly-e2e.yml`, `.github/fly-e2e/oauth-mcp-fixture.mjs`) - The OAuth server is a small Node script, with no dependencies, on a disposable public Sprite. It issues 90-second access tokens. That fits the free plan's three-Machine limit, and the Sprite is deleted at teardown even on failure. - The extensions mode now needs `FLY_E2E_SPRITES_TOKEN` on Fly Machines runs too, for that Sprite. - The workflow first saves the Bearer server with a wrong token and checks it is refused quickly. It then saves the real token and signs in to the OAuth server through the Settings API. - The agent's file goes from 4 to 8 lines, including the exact stateful, Bearer and OAuth echo tokens. - The verify step checks the logged session and auth modes, that every server got at least one tool call, and that stateful sessions were deleted. It also checks the OAuth fixture reported at least one refresh. - The step summary shows `urlServers=4` and a table of each server's session mode, auth, tool calls and refreshes. Choices you may want to revisit - The OAuth fixture's tokens last 90 seconds rather than the 60 the issue suggests. ProPR refreshes a token one minute before it expires, so a 60-second token would be refreshed on every call. - The stateless check uses DeepWiki rather than Microsoft Learn: Learn returns a session id, so it counts as stateful. ProPR-Agent: claude/claude-opus-5-5
|
/ultrafix goal=8 max=3 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 3) First action:
|
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds gateway-owned MCP sessions, OAuth-compatible reuse, discovery support, and expanded smoke coverage. It needs changes before merge: transport completion, concurrent-call rejection, and failed-handshake cleanup have concrete lifecycle defects. ✅ Write replay protection — The 404 recovery path explicitly refuses to replay ✅ Session isolation — Sessions are keyed by grant and server; the gateway supplies session headers and redacts the current session ID from returned tool content. ✅ Focused coverage — Added tests cover session reuse, read recovery, write refusal, OAuth refresh, and real TLS transport. Current checks report 24 passed and no failures. This review is a static analysis of the supplied code; no commands or tests were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Capacity rejection closes active sessions
F2: 🔴 Completed event streams retain the only socket
F3: 🔴 Unauthorized handshakes abandon allocated resources
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Strengthen smoke lifecycle evidenceThe workflow’s global OAuth counters can include refreshes before the agent opens its session and DELETEs from Settings validation. Recording counter baselines around the agent run, or checking session-specific fixture events, would make the smoke demonstrate refresh and deletion for that run more directly. This is an optional improvement to evidence quality; the added unit test already exercises refresh within an open session. ScoreThe implementation has substantial focused coverage and passing current checks, but three session-lifecycle defects require correction before merge. The fixes can remain localized to admission handling and transport/session ownership. Score: 5/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit ca2bcda
Summary of ChangesI fixed F1, F2 and F3. Each has a regression test that fails on the original code and passes now. F1 – a call turned away for capacity no longer closes active sessions (
F2 – an event stream the server leaves open no longer holds the only connection (
F3 – a failed handshake no longer leaves a session or connection behind (
Checks run: core typecheck and lint on Nothing here changes what users see, so there are no new previews. Review digestRisk-tiered paths
Diff size: 5 files changed, +286/−26 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Live Sprites run fails at "Start the OAuth MCP fixture on a disposable Sprite"https://github.com/integry/propr/actions/runs/45968843244 (bef91c8, Cause: Fix: use Push this as soon as possible; I'll run the Sprites extensions mode again on the new head. Nothing was left behind: the teardown deleted the agent apps and the fixture Sprite. |
I fixed F1, F2 and F3. Each has a regression test that fails on the original code and passes now. **F1 – a call turned away for capacity no longer closes active sessions** (`mcpGateway.ts`) - When `grantSnapshot` returns a 401, the gateway now checks the grant row. It closes the run's sessions only if the grant is inactive, missing or expired. - A call refused because the grant is at its concurrency or budget limit leaves the sessions alone. If the check itself fails, sessions are kept and the 15-second sweep handles them later. - The sweep's own liveness check now uses the same function, so the two can't drift apart. - Test: with `connections = 4` and then with the call budget used up, the refused call leaves the session in place and the next call reuses it. Once the grant expires, the next refused call deletes it. **F2 – an event stream the server leaves open no longer holds the only connection** (`endpointPolicy.ts`) - Once a response is settled on a pinned connection, the transport clears the 10-second request timer and reads out the rest of the response. - If the server hasn't closed the response within 1 second, the transport closes it. The next request then opens a new connection to the same vetted address. - A server that ties sessions to one connection will answer that next request with 404. The existing recovery handles it: read calls reopen the session and are replayed once, write calls fail without being replayed. That trade-off can't be avoided, because the client can't reuse a connection while a response is still open on it. - The same handling covers the drained responses on error, 202/204 and DELETE. - Test: a real TLS server sends each tool-call reply over an event stream and never closes it, on a write server. Three calls finish in about 2 seconds rather than 10 seconds each, the session is never reopened, and all three streams end up closed. - **Decision for you:** against such a server, each call after the first still waits up to that 1-second grace. A shorter grace makes those calls faster, but risks cutting off normal servers whose closing bytes arrive a moment after the reply. **F3 – a failed handshake no longer leaves a session or connection behind** (`mcpUpstreamSessions.ts`, plus the gateway's handshake wrapper) - **Refusal on the initialized notification:** a new error type (`ExtensionUpstreamHandshakeUnauthorizedError`) carries the half-open session. The entry keeps it, and after the OAuth refresh the gateway resends only the notification, in that same session. If the entry was dropped in the meantime, the session is deleted. Grant end, the sweep, eviction and shutdown also delete a session still in this state. - **Refusal on `initialize` or `server/discover`:** the connection opened for that attempt is now closed before the error is passed on. - **Same gap in the Settings check:** "Test connections" and "Discover tools" don't refresh tokens, so they now delete a session left half-open and close its connection. - **Byte-accounting failure:** if recording the handshake's request bytes fails, the new session is closed. The bytes of a refused handshake are now recorded too. - Closing a session is now safe to repeat: a second close of the same session does nothing. - Tests: a bearer server refuses the notification once, and the next call finishes the same session with no second `initialize`. An OAuth server refuses it, then the token is refreshed, the notification retried and the session used for the tool call; only one session is ever deleted. There are also checks that refusals on `initialize`, `server/discover` and the Settings check close their connection, and that an entry dropped mid-handshake doesn't keep its session. **Checks run:** core typecheck and lint on `src/extensions` are clean. These suites pass: `extensionUpstreamSessions` (11), `extensionOAuth` (20), `flyOAuthMcpFixture`, `extensionProfiles`, `extensionTaskAutoApply`, `extensionLibraryUsage`, `extensionPinnedLookup`, `extensionRemoteRuntime`, `extensionPackageServers`, and the API's `extensionDiscovery` and `extensionProfileRoutes`. Some of these only pass when run the way the repo's scripts run them (`NODE_ENV=test`, `--experimental-test-module-mocks`). Without those, `extensionProfiles` fails the same way on the original code. I didn't run the full repository suite. Nothing here changes what users see, so there are no new previews. PR: #3826 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
✅ Applied the requested follow-up changes in commit 6991785 Summary of ChangesI fixed the "Start the OAuth MCP fixture on a disposable Sprite" step, but I couldn't test it against a real Sprite here, so your rerun is the first live check. The fix: the call at sprite.execFile('sh', ['-c', 'mkdir -p ~/oauth-fixture && cd ~/oauth-fixture && pwd'])The SDK no longer splits the string on spaces. The other calls: that was the only Checks:
This only changes the workflow, so there's no visual preview. Review digestRisk-tiered paths
Diff size: 1 file changed, +1/−1 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed the "Start the OAuth MCP fixture on a disposable Sprite" step, but I couldn't test it against a real Sprite here, so your rerun is the first live check.
**The fix:** the call at `.github/workflows/fly-e2e.yml:324` now passes the shell command as one argument:
```js
sprite.execFile('sh', ['-c', 'mkdir -p ~/oauth-fixture && cd ~/oauth-fixture && pwd'])
```
The SDK no longer splits the string on spaces. `sh` expands `~` itself, so the directory it prints (used as `home` in the following lines) is the same as intended.
**The other calls:** that was the only `sprite.exec(...)` string in the workflow. The rest of the fixture step already takes argument arrays: `createService` gets `cmd: 'bash', args: ['-lc', …]`. The two teardown steps (reaping the agent's Sprites and deleting the fixture Sprite) only list and delete Sprites, so neither runs a command on one.
**Checks:**
- The workflow file still parses as YAML.
- One of the two tests in `test/flyE2eMcpAutomation.test.ts` fails: the REST-routes test under `PROPR_SPRITES_MCP_TRANSPORT=forward` expects `['acme/fixture']` and gets `[]`. It fails the same way with the workflow file as it was at HEAD, so this change didn't cause it, but I haven't looked into why it fails.
This only changes the workflow, so there's no visual preview.
PR: #3826
Comment by: @integry (ID: 7214162548)
Model: Claude Opus 5.5
ProPR-Agent: claude/claude-opus-5-5
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds upstream MCP session management, SSE transport support, OAuth session reuse, and expanded Fly smoke coverage. It needs changes before merge: handshake failures can leave unusable sessions cached, SSE parsing depends on network chunk boundaries, and handshake response bytes escape normal call accounting. ✅ Write replay protection — The 404 recovery path explicitly refuses to replay tool calls on write-capable servers. ✅ OAuth handshake recovery — Sessions assigned before an initialized-notification 401 are retained and resumed, with focused tests covering refresh and eventual cleanup. ✅ Runtime coverage — The workflow now exercises four URL-server configurations and checks their session modes, authentication, calls, and cleanup telemetry. This review is based on static analysis of the supplied code; no commands or tests were run. The supplied current-head status shows 22 passed checks, one pending, and no failures. Live smoke evidence remains outstanding. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F4: 🔴 Failed initialization notifications become cached sessions
F5: 🔴 Split CRLF corrupts valid SSE events
F6: 🔴 Handshake responses bypass the run byte budget
SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Attach both runtime smoke resultsThe description explicitly acknowledges that the Fly smoke has not run. Attach the Sprites and Fly Machines summaries when credentials are available. This would provide deployment evidence beyond the supplied unit and TLS tests; it is a verification follow-up rather than a separately demonstrated code defect. S3: 🟢 Verify refresh within an open sessionThe smoke checks the fixture's cumulative refresh counter, which can include a refresh before the run opens its session. A follow-up could require two OAuth calls separated by refresh and correlate them with one session. The focused OAuth tests already exercise session reuse across refresh, so this would strengthen live coverage. ScoreThe implementation has substantial focused coverage and clear session ownership, but three correctness defects remain in initialization, stream parsing, and budget enforcement. Passing checks do not cover these failure paths. Score: 5/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit ae6d03d
Summary of ChangesI fixed F4, F5 and F6. Each has a regression test that fails on the original code and passes now. The upstream-sessions suite passes (14 tests), as do the other extension suites in core and the API (78 tests); lint and the core typecheck are clean. I didn't run the full repository suite. F4 – a session is only kept once the initialized notification is accepted (
F5 – an event stream split between
F6 – handshake responses count against the call's budget (
I also added two sentences on these behaviours to Found but not fixed (outside F4–F6):
Review digestRisk-tiered paths
Diff size: 5 files changed, +207/−22 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed F4, F5 and F6. Each has a regression test that fails on the original code and passes now. The upstream-sessions suite passes (14 tests), as do the other extension suites in core and the API (78 tests); lint and the core typecheck are clean. I didn't run the full repository suite. **F4 – a session is only kept once the initialized notification is accepted** (`mcpUpstreamSessions.ts`, `mcpGateway.ts`) - Errors on the notification are no longer swallowed. A refused credential still keeps the session so it can resume after a token refresh, as before. - Any other failure (an error status, a timeout, a dropped connection) raises a new error, `ExtensionUpstreamHandshakeIncompleteError`, carrying the half-open session. I chose to close the session rather than keep a retryable state: a kept one could get stuck if the upstream had already lost it. - On that error the gateway deletes the session upstream, closes its connection and fails the call. The next call starts a fresh `initialize`. The same applies when a resumed notification fails after a refresh. The bytes the handshake sent are still charged. - "Test connections" and "Discover tools" now report the server as unavailable and delete the session they were given. - `initialize` and `server/discover` still treat a non-credential failure as "this protocol version isn't available", so the fallback between versions is unchanged. - I checked the mcptest echo, DeepWiki and Microsoft Learn servers live: all three answer the notification with 202, so this stricter check doesn't break them. **F5 – an event stream split between `\r` and `\n` parses correctly** (`endpointPolicy.ts`) - The parser now remembers when a chunk ended with a carriage return. If the next chunk starts with a line feed, that line feed completes the same line ending instead of counting as an empty line. - Test: a real TLS server sends one JSON message over three `data:` lines, with every chunk boundary between a `\r` and its `\n`. **F6 – handshake responses count against the call's budget** (`mcpGateway.ts`, `endpointPolicy.ts`) - Every upstream response in a gateway call now shares that call's single 1 MiB reservation. That covers the handshake, a new handshake after a lost session, and the call itself. - Each request can only read what the earlier ones left: the transport has a new per-request limit, `maxBytes`. The call is charged the total. - This applies to first `tools/call` and `tools/list` requests, calls replayed after a lost session, notifications, and the agent's own `initialize`. Before, the handshake was only charged on that last one. An agent `initialize` answered by the upstream directly is no longer counted twice. - If a response would go past what the handshake left, the call fails and is charged the full reservation, the same as any oversized response. - Test: a real TLS server sends a 900 KiB `initialize` response. It checks the charges on a first tool call, on a call in the open session, after a lost session and on an agent `initialize`, and that a 200 KiB tool response after it fails. I also added two sentences on these behaviours to `docs/docs/features/agent-extensions.md`. There's no visible change, so no previews. **Found but not fixed** (outside F4–F6): - When the upstream sends a server-to-client request, such as sampling, the gateway's error reply goes out in the background. The upstream's answer to that reply isn't counted against the run's budget. - When a response is drained after the call is settled, or a session is deleted, the transport reads the remaining bytes for up to the 1-second grace. Those bytes aren't counted either, and nothing caps them. PR: #3826 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds gateway-owned MCP sessions, SSE support, OAuth refresh continuity, and expanded Fly smoke coverage. The implementation is substantial and generally cohesive, but response accounting needs correction before merge. ✅ Conservative write recovery — A session-loss response fails a write call without replaying it; dedicated tests cover that behavior. ✅ Handshake cleanup — Failed initialized notifications retain ownership of the assigned session so it can be resumed after authentication failure or closed. ✅ Transport coverage — Added TLS tests exercise connection reuse, split SSE framing, and streams left open after a reply. The supplied current-head status reports 20 passed checks, three pending, and no failures. This review is a static analysis of the supplied code; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F7: 🔴 Account for all upstream response traffic
SuggestionsThese are optional follow-ups and are not sent to S4: 🟢 Strengthen smoke refresh evidenceThe smoke checks cumulative fixture refreshes, which can include refreshes before the agent opens its session. Recording a baseline and requiring a refresh between two calls in the same agent session would demonstrate the intended live behavior more directly. This is optional additional integration evidence because the new unit test already exercises refresh within an open session. S5: 🟢 Attach both runtime smoke resultsThe supplied description explicitly says the Fly smoke was not run. Attach results for Sprites and Fly Machines when credentials are available, including the per-server summaries. This would substantiate the deployment claims beyond the local transport and fixture tests. ScoreThe session lifecycle and tests are strong, but the new transport paths undermine an existing resource boundary. That requires correction before merge; live runtime verification also remains outstanding. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit f0d8879
Summary of ChangesI fixed F7. The gateway now counts every upstream response byte as it is read, so all three paths the finding describes are charged against the call's one reservation. Three new regression tests fail on the original code and pass now. What changed
Tests (all against a real TLS upstream, in
Checks run
There's no visible change, so no previews. Found but not fixed (outside F7): the gateway's answers to server-to-client requests are small error messages, but the bytes it sends for them are still not added to the run's request-byte total. The finding was about response bytes only. Review digestRisk-tiered paths
Diff size: 4 files changed, +170/−18 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Live Sprites run: the OAuth fixture's Sprite uses the org's last Spritehttps://github.com/integry/propr/actions/runs/45972876911 (6991785, The Fly Free Plan allows 3 Sprites per org, like its 3 Machines, and the e2e org has two long-lived Sprites that must stay. On a Sprites run, the OAuth fixture's Sprite plus the agent's Sprite comes to 4. So on the Sprites runtime the fixture can't be a Sprite. Fix: host the OAuth fixture in the pool the run's agents don't use.
Push this soon. I'll then run extensions mode on Sprites and then Fly Machines. The ultrafix cycle that's running can carry on in parallel. |
I fixed F7. The gateway now counts every upstream response byte as it is read, so all three paths the finding describes are charged against the call's one reservation. Three new regression tests fail on the original code and pass now. **What changed** - **Transport** (`endpointPolicy.ts`): - Each exchange can now be given a callback that gets every chunk read from the upstream, whether the exchange later succeeds or fails, including error bodies drained on a pinned connection. If the callback says the reservation is spent, the response is ended and the exchange fails. - Once the matching event-stream reply has arrived, the next data from the upstream is counted and the stream is ended right away. Before, the gateway kept reading for the one-second grace without counting anything. A stream that just closes after the reply still keeps the pinned socket. - **Gateway** (`mcpGateway.ts`): - The handshake, recovery handshake, the call itself and the answers to server-to-client requests all report to one counter. - So a swallowed `initialize` failure stays charged when the gateway falls back to `server/discover`, and the discovery request only gets what is left. - The answers now have a byte limit and share the reservation; before, each had its own full budget. - When the call ends, its charge is set from everything read so far. A chunk that arrives after that (an answer still in flight, or a late event) is added to the run's byte total and ends that response. - A call that reads past its reservation is charged the full reservation, nothing more. The chunk that crossed the limit is read but not charged on top, which matches the existing oversized-response test. **Tests** (all against a real TLS upstream, in `extensionUpstreamSessions.test.ts`) - A 600 KiB unparsable `initialize` reply, then a successful `server/discover` and tool call: the run is charged everything the upstream sent. The original code charged 168 bytes instead of 614,569. With an `initialize` reply over the reservation, the call fails and is charged the full reservation. - An event stream that keeps sending 128 KiB notifications after the reply: the late bytes are charged, and the stream is ended well before the one-second grace. - Three server-to-client requests whose answers each get a 100 KiB response: everything is charged with the call. Eight answers of 200 KiB fail the call, which is charged the full reservation. **Checks run** - **Core:** the upstream-sessions suite and the other core extension suites pass (142 tests, with `PROPR_DEMO_MODE=true`). Lint and the core typecheck are clean. - **API:** the extension tests pass except one, "server mounts extension gateway before auth…", which fails the same way with this branch's original gateway and transport. The discovery test needs `--experimental-test-module-mocks` to run. I didn't run the full repository suite. - **Docs:** I extended the byte-accounting paragraph in `docs/docs/features/agent-extensions.md` to cover these cases. There's no visible change, so no previews. **Found but not fixed** (outside F7): the gateway's answers to server-to-client requests are small error messages, but the bytes it sends for them are still not added to the run's request-byte total. The finding was about response bytes only. PR: #3826 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
|
|
✅ Applied the requested follow-up changes in commit 672fc66 Summary of ChangesOn Sprites runs, the OAuth fixture now runs on a Fly Machine in its own disposable app, so it no longer takes the org's last Sprite. Fly Machines runs keep it on a Sprite. I haven't run it live: I don't have Fly credentials here. Your Sprites dispatch will be the first real test of the new Machine step. How the host is chosen (
Checked
Worth checking in the Sprites run
I also updated Review digestRisk-tiered paths
Diff size: 3 files changed, +97/−15 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
On Sprites runs, the OAuth fixture now runs on a Fly Machine in its own disposable app, so it no longer takes the org's last Sprite. Fly Machines runs keep it on a Sprite. I haven't run it live: I don't have Fly credentials here. Your Sprites dispatch will be the first real test of the new Machine step. **How the host is chosen** (`.github/workflows/fly-e2e.yml`) - A new job variable picks the host from the runtime: `sprites` gives a Fly Machine, `fly-machines` gives a Sprite. Both use the name `propr-e2e-oauth-<run>-<attempt>` (the old `OAUTH_SPRITE` variable is now `OAUTH_FIXTURE_NAME`). - **Sprites runs:** a new step creates the app and writes a `fly.toml` for it: - Image `node:22-slim`, with the fixture file copied in. The Fly proxy serves it at `https://<name>.fly.dev` on 443, with HTTPS forced. - `auto_stop_machines = "off"` and `min_machines_running = 1`, plus `STATE_FILE` on the Machine's disk. - `flyctl deploy --ha=false`, so it gets one Machine rather than the default two. The step then checks the app has exactly one; with the ProPR Machine that's 2 of 3. - If the deploy allocated no public IPs, it allocates a shared IPv4 and an IPv6 address. It waits for `/health` and checks the resource metadata, like the Sprite path. - **Fly Machines runs:** the existing Sprite step runs unchanged. - Both paths run the same fixture code and write the same `OAUTH_FIXTURE_ORIGIN`, so the rest of the workflow is unchanged. - **Step summary:** the start step adds a line naming the host kind, the name and the URL. The final OAuth stats line also names the host. - **Teardown:** a new step destroys the fixture app with `flyctl apps destroy --yes`. Like the Sprite delete, it is keyed on a marker written before the app is created, so it runs whatever failed. - **Secrets:** the same as before. Sprites runs always need the Sprites token, and Fly Machines runs with extensions still need it for the fixture Sprite. **Checked** - The workflow parses as YAML and the Machine step's script passes `bash -n`. The generated `fly.toml` is valid TOML with the values you'd expect. - `flyctl` v0.5.19 has every flag the step uses. `flyctl config validate` needs a token, so the config itself is untested against Fly. - `flyOAuthMcpFixture.test.ts` and `flyE2eMcpAutomation.test.ts` pass. **Worth checking in the Sprites run** - I expect the fixture file to land in the Machine through the `[[files]]` section of `fly.toml`. If it doesn't, the Machine won't start and the run fails at the `/health` wait. I also updated `setup-fly.md`, the extensions input description and the fixture's header comment for the two hosts. There are no visual previews: it's a CI-only change. PR: #3826 Comment by: @integry (ID: 7215604180) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
I fixed F9. When an entry is dropped, `open` now closes any session it just opened and fails the call. A dropped entry can't open a new upstream session, either in `attempt`'s 404 recovery or in any later `open`. The three new tests pass, along with the existing `extensionUpstreamSessions` and `extensionOAuth` suites. All three new tests fail when run against the HEAD sources, so they do catch the bug. Lint (zero warnings) and the typecheck are clean for core's sources; core's lint config ignores test files, so the test file wasn't linted. **What changed (`mcpUpstreamSessions.ts`)** - When an entry is dropped, the registry now records why. - `open` checks that first and refuses the entry: - a capacity eviction gets `ExtensionUpstreamSessionCapacityError`. - any other reason (grant end, shutdown) gets the new `ExtensionUpstreamSessionEndedError`. - `open` checks again after the handshake. If the entry was dropped meanwhile, the session it just got is closed (with a `DELETE` if stateful) and the call fails with that error. Before, it returned the closed session. - A second caller waiting on the same handshake is checked the same way after it finishes, so it can't get the closed session either. **Gateway (`mcpGateway.ts`)**: the gateway turns the new error into the same 401 a call gets after its grant ends (`Extension grant expired or exhausted`). The capacity error is a 503 (`MCP session capacity reached`), as it already is when a new entry hits the cap. **Tests (`extensionUpstreamSessions.test.ts`)** - **Grant end during the first handshake:** `closeGrant` runs while the upstream answers `initialize`. The call fails with the 401, the tool call is never sent, the new session is deleted, and nothing is kept. - **Grant end during the 404 re-initialize:** the upstream loses the session, and `closeGrant` runs during the new `initialize`. The call fails with the 401, the read call is not replayed, `upstream-session-2` is deleted, and no third session is opened. - **Calls on a dropped entry:** `open` on an entry whose grant ended, or one evicted for capacity, is refused without starting a handshake. A second caller waiting on the same handshake when the grant ends is refused too, and that session is closed. One case still works as before. If the grant ends during a handshake the upstream refuses with 401, the original 401 still comes back, so an OAuth server may still refresh its token once. The retry is then refused by the new check and opens no session. I left that alone so an existing test's expected error stays the same. There's nothing visible to users, so I made no preview. PR: #3826 Comment by: @integry (ID: 7218712278) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds upstream MCP sessions, protocol negotiation, OAuth session reuse, and runtime smoke coverage. It needs a localized cleanup fix before merge. ✅ Handshake fencing — Dropped entries refuse subsequent opens, and successful handshakes completed after removal close their new state and fail the call. Tests cover initial and recovery handshakes. ✅ Bounded transport — Response metering includes handshakes and server-request replies; stateless connections permit parallel calls while stateful connections have a bounded queue. This review is a static analysis of the supplied code; no commands were run. Current checks show no failures, with 17 pending. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F10: 🔴 Preserve credentials during cleanup callback replacement
SuggestionsThese are optional follow-ups and are not sent to S12: 🟢 Attach updated runtime smoke evidenceAttach the planned Sprites and Fly Machines results for the current head, including the session and authentication tables. The supplied successful Sprites evidence predates the latest changes, and the Fly endpoint correction has no supplied successful live result. This would strengthen deployment confidence without establishing another code defect. ScoreThe implementation has substantial targeted coverage and addresses the requested handshake race, but authenticated session cleanup still has a concrete concurrency defect. A localized correction and regression test should resolve it. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
Please fix F10 from the latest review. A new call's |
|
✅ Applied the requested follow-up changes in commit 7fb0c0f Summary of ChangesF10 is fixed. A grant-end Change
Test (
Checks
No preview was made, because nothing visible changed. Review digestRisk-tiered paths
Diff size: 3 files changed, +56/−8 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
F10 is fixed. A grant-end `DELETE` now always carries the last credential that worked on the entry, including when it races a call still waiting on `credential()`. **Change** - **`mcpUpstreamSessions.ts`:** `entry()` sets `remove` only when it creates the entry. For an existing entry it now updates only `alive` and the call counters. `credentialUsed(entry, credential, remove)` is the one place `remove` gets replaced, and it runs only after a call has resolved its credential. - **`mcpGateway.ts`:** the shared `latest` variable is gone. A new entry starts with a no-op `remove`, since it has no session to delete yet. `attempt(used)` then sets the `DELETE` with that call's resolved token, and the 401 retry does the same with the refreshed token. Nothing else changed. **Test** (`extensionOAuth.test.ts`, "a grant ending while a second call waits on its credential deletes the session with the previous token") - The first call opens and uses an OAuth session. - The clock moves past the refresh margin, so the second call's `credential()` starts a refresh, and the test holds that refresh request. - While it's held, the grant ends with `closeGrant`. The test checks that the one `DELETE` is for `oauth-session-1` and carries the first token. - Once the refresh is released, the second call fails with the grant-expired error and no new upstream session is opened. **Checks** - **New test:** passes with the fix. Against the HEAD source it fails with `bearer: undefined`, which is the F10 bug. - **Related suites:** `extensionOAuth`, `extensionUpstreamSessions` and `flyOAuthMcpFixture` pass. - **`extensionProfiles` suite:** "catalog stdio is callable through both selected authorized launcher policies…" fails, and the run hangs at exit. That test fails the same way on HEAD without this change. The run was cut off before the failure details printed, so I don't know the exact cause; it is probably the container environment. - **Lint and typecheck:** both are clean for `packages/core`. No preview was made, because nothing visible changed. PR: #3826 Comment by: @integry (ID: 7219181440) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
Fly Machines run on 7fb0c0f:
|
|
✅ Applied the requested follow-up changes in commit fe7fb19 Summary of ChangesF9/F10 didn't cause this. Test connections never goes through the gateway's session pool. The run's timing points to one 10-second request timeout against the Sprite fixture, but I can't prove it was the fixture. Test connections now reports a 1. F9/F10 and Test connections
3. Was it the fixture?There's no direct evidence. The ProPR app logs in the failure dump stop at 14:02:47, at "Extension OAuth server connected", before Test connections ran. The fixture's
So As you asked, the workflow now waits for the fixture's 2. The
|
| Command | Description | Example |
|---|---|---|
/merge |
Merge target branch into this PR and resolve conflicts | /merge |
/review |
Request an AI code review | /review or /review claude-sonnet |
/fix |
Address review blockers, or blockers and suggestions with /fix all |
/fix, /fix all, or /fix F3 S5 |
/switch |
Change the AI model for this PR | /switch claude-opus |
/use |
Override the model for a single follow-up run | /use claude-sonnet |
/ultrafix |
Loop review→fix cycles until score goal is met | /ultrafix or /ultrafix goal=8 max=10 |
🤖 Generated by ProPR
Processing comment ID: 7220349553✓
F9/F10 didn't cause this. Test connections never goes through the gateway's session pool. The run's timing points to one 10-second request timeout against the Sprite fixture, but I can't prove it was the fixture. Test connections now reports a `reason` for any unavailable server, and the workflow prints it. ## 1. F9/F10 and Test connections - **A different path.** Test connections (`validate` in `extensionProfileRoutes.ts`) calls `probeExtensionMcp` directly. It never uses `sessions.entry`/`open`, the new no-op `remove`, the fence, `credentialUsed` or `ExtensionUpstreamSessionEndedError`. Between 45063f1 and 7fb0c0f only `mcpGateway.ts` and the session-pool part of `mcpUpstreamSessions.ts` changed. `probeExtensionMcp`, `openUpstreamSession` and the transport in `endpointPolicy.ts` are byte-identical. - **New test.** `flyOAuthMcpFixture.test.ts` runs Test connections against the real OAuth fixture and ProPR's OAuth client: - Before sign-in it reports unavailable with reason `OAuth not connected`. - Right after sign-in it reports `reachable`, `stateful`, `oauth`. The fixture counts one session opened and deleted, and no extra 401s, so the token went with every request. - After the run's gateway session is dropped at grant end, it is still reachable, in a new session of its own. ## 3. Was it the fixture? There's no direct evidence. The ProPR app logs in the failure dump stop at 14:02:47, at "Extension OAuth server connected", before Test connections ran. The fixture's `/stats` was never read. What the step timestamps show: - **This run (46011054496):** the wrong-token check ended at 14:02:46.5 and the step failed at 14:02:59.4. Sign-in plus Test connections took about 13 s. - **Last green Fly Machines run (45998138280, fixture also on a Sprite):** the same stretch took under 4 s. The first Test connections, covering all four servers, took 1 s in both runs. So `url-oauth` spent about 10 s, which is the per-request timeout (`EXTENSION_LIMITS.timeoutMs`). The likeliest reading is that `initialize` to the Sprite got no answer in time. The fallback `server/discover` then failed fast, which yields `unavailable`. The Sprite had just answered the token exchange, though, so "cold" isn't proven. As you asked, the workflow now waits for the fixture's `/health` right before Test connections. It also prints the fixture's `/stats` counters before and after, which show whether ProPR's requests reached it. ## 2. The `reason` field An `unavailable` result now carries a short reason with no secrets in it: - **HTTP failures:** `initialize: timeout after 10 s; server/discover: HTTP 400`, `HTTP 503`, `JSON-RPC error -32600` (the code only, never the message). - **Connection and credential failures:** `connection failed (ECONNRESET)`, `credential refused (HTTP 401)`. - **OAuth:** `OAuth not connected`, `token refresh failed`, `token refresh refused: sign in again`. No response body, header, host or token goes into it. The loop moved into a new core file, `extensionConnectionTest.ts`, which the route calls. The transport's failures now carry a reason through `ExtensionUpstreamRequestError`; the error message is still `MCP connection failed`. The OpenAPI text and the UI type gained the field, but the Settings page doesn't display it yet. The workflow prints each URL server's status and reason, how long Test connections took, and the reason for the wrong-Bearer refusal. A failure's `::error::` line now names the server and its reason. I checked those `jq` lines against sample results. ## Verification - **Passing:** the new reason test in `extensionUpstreamSessions.test.ts` (real TLS transport for the HTTP status and JSON-RPC cases), the fixture test, the other core extension test files, the API extension route and OpenAPI tests, `gen:openapi:check`, and the `test/fly*` workflow tests. Lint and typecheck are clean for core, api and the UI file. - **Not clean, same on clean HEAD:** in `extensionProfiles.test.ts`, 44 tests pass, `catalog stdio …` fails ("stdio fixture closed"), and the process never exits. I didn't run the full repository suite. No previews: nothing in the UI changed visibly. PR: #3826 Comment by: @integry (ID: 7220349553) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryI resolved the one merge conflict, in What the conflict was about: Both branches rewrote the same paragraph in the "Fly Machines" section, the one about workspaces, credentials, runtime packages and how agent Machines reach MCP.
How I resolved it: I kept one paragraph that combines both changes:
Why: Each side updated a different fact in the same paragraph, and neither change replaces the other, so the merged text has to carry both. On the MCP address I followed this PR, because it matches the code: The edit is in the working tree, but 🤖 Resolution Details
System-triggered merge conflict resolution |
|
/merge |
Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - docs/docs/architecture/agent-runtime.md PR: #3826 Model: Claude Opus 5.5
|
🔀 Auto-merged No conflicts were found — the merge was verified by an AI agent. 🤖 Verification Details
System-triggered merge conflict resolution |
|
🔀 Auto-merged No conflicts were found — the merge was verified by an AI agent. 🤖 Verification Details
System-triggered merge conflict resolution |
Fly Machines on 6efa15b: the same 10 s hang to the Sprite-hosted fixture. Likely cause: the gateway dials only
|
|
✅ Applied the requested follow-up changes in commit 2337a9d Summary of ChangesMCP and OAuth requests now try every vetted address with Happy Eyeballs fallback instead of dialling only What changed
Tests
There are no previews, since nothing in the UI changed. Review digestRisk-tiered paths
Diff size: 18 files changed, +449/−61 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
MCP and OAuth requests now try every vetted address with Happy Eyeballs fallback instead of dialling only `addresses[0]`. All the extension suites pass, plus the new tests, lint and typecheck. I couldn't run anything from inside a Fly Machine, so I haven't confirmed that IPv6 caused the 10 s hang. The rerun you have planned will show it either way.
**What changed**
- **Every vetted address is kept.** `resolveExtensionEndpoint` returns all the addresses that passed the public-address or pinned-address check.
- **Connecting** (new `packages/core/src/extensions/happyEyeballs.ts`):
- Addresses are tried in resolver order, alternating families, starting the next one 250 ms after the previous one starts, or at once if it fails.
- Each address gets 3 s to connect. The whole connect phase must finish within the 10 s request timeout, and connect time counts against it.
- The first socket to connect wins, every other attempt is closed, and only IP literals are dialled. TLS then runs on the winning socket with the original hostname.
- **Pinning:** a session's connection records the address that connected first. Every later connection in that session dials only that address, including the pool a stateless server switches to after the handshake. DNS and policy are still checked on every request.
- **OAuth:** discovery, registration, token and refresh requests (`oauth/check`, `oauth/start`, callback, refresh) use the same connector.
- **Reasons:**
- A failed connect gives `connect timeout (IPv6 2606:…, then IPv4 8.8.8.8)` when everything timed out. Otherwise it gives `connect failed (IPv6 … timed out, then IPv4 … ECONNREFUSED)`, plus `; N more not tried` if the overall limit ran out first.
- The `oauth/check` 502 body now carries the reason: `{"error":"The MCP server could not be reached","reason":"…"}`.
- Test connections shows `token refresh failed (<reason>)` when a refresh can't connect.
- Reasons include the vetted IP addresses, as in your example. They only go to administrators (Test connections and the Settings API), never to agents.
- **Workflow:** when `oauth/check` or `oauth/start` fails, the workflow now prints the error body (error and reason) as an `::error::` line instead of exiting silently.
- **Docs:** the extensions page describes the fallback and the new reasons.
**Tests**
- **New file `packages/core/test/extensionHappyEyeballs.test.ts`:**
- A lookup returning a black-holed IPv6 address and then a working IPv4 one connects over IPv4 in about 260 ms. An MCP request and an OAuth request over the same setup both succeed in under 3 s.
- If any resolved address is non-public, the request is refused and nothing is dialled.
- A session keeps using the address that connected, even after the DNS answers change, and the policy check still runs on each request.
- The reason format is checked.
- **`oauth/check` reason:** a route test checks that the 502 body carries the reason.
- **Existing tests:** some answer a public address from a local TLS server. They now redirect the dial with a small test helper, because the connector no longer goes through the URL host. One discovery test now expects the new dial agent where it used to expect `agent: false`.
- **Live check from this container:** the new transport reached mcptest.io and DeepWiki, both of which have A and AAAA records, in 550–730 ms.
There are no previews, since nothing in the UI changed.
PR: #3826
Comment by: @integry (ID: 7221952672)
Model: Claude Opus 5.5
ProPR-Agent: claude/claude-opus-5-5
Fly Machines on 2337a9d: still a 10 s hang, but it's not the connecthttps://github.com/integry/propr/actions/runs/46027327976: Before changing anything else, we need to know where the request stops. Please add failure diagnostics to the workflow, all secret-free:
If the probe shows that one family (say IPv6) connects but never answers from a Fly Machine while the other works, the dialer can't detect that at TCP level. In that case also widen the fallback: a request that got no response is retried once over the other family when it's idempotent (GET discovery, metadata, I'll rerun after this. |
|
✅ Applied the requested follow-up changes in commit 29bd6d4 Summary of ChangesI've added the three diagnostics. Nothing else in the gateway changed. I didn't widen the fallback to retry over the other family, because that depends on what the probe shows. 1. Fixture request log (
2. New failure step: "Probe the OAuth fixture path and dump its request log on failure"
3. Stage in the 10 s reason (MCP gateway and OAuth requests alike)
Tests
Reading the rerun
Review digestRisk-tiered paths
Diff size: 8 files changed, +184/−13 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I've added the three diagnostics. Nothing else in the gateway changed. I didn't widen the fallback to retry over the other family, because that depends on what the probe shows.
**1. Fixture request log** (`.github/fly-e2e/oauth-mcp-fixture.mjs`)
- Each request is written to `REQUEST_LOG` (JSON lines) twice: once when it arrives and once when its response finishes or its connection closes. A request that arrives and then hangs still shows up as a `start` entry.
- Each entry has: time, method, the path without the query, remote address, `Fly-Client-IP` and `X-Forwarded-For`, status (null if no headers were sent), whether the response completed, and duration.
- The two address headers are cut to 200 characters, and anything not IP-like becomes `*`. Queries, other headers and bodies are never logged, so no client ids, codes or tokens are written.
- The log is at `~/oauth-fixture/requests.jsonl` on the Sprite and `/tmp/oauth-mcp-fixture.requests.jsonl` on the Fly Machine host.
**2. New failure step: "Probe the OAuth fixture path and dump its request log on failure"**
- It runs on `failure()` in extensions mode, before any teardown step, and always exits 0.
- It requests `$OAUTH_FIXTURE_ORIGIN/health` three times each with `-4` and `-6`, using your `-w` format (`%{remote_ip} connect= tls= ttfb= code=`, `--max-time 20`). It also prints the resolved addresses and curl's exit code and error. This runs from the runner first, then from ProPR's Machine through `flyctl ssh console --app "$APP" --container app -C`. The control-plane image has curl.
- It then prints the last 300 log entries: with `sprite exec` (`execFile('tail', …)`) for a Sprite host, or `flyctl ssh console` for the Fly Machine host. It finishes with the `/stats` counters, minus the echoes.
- I ran the probe script here against a public origin, both directly and through the same base64 `sh -s` path the ssh command uses. This container has no IPv6, so only the IPv4 lines show real timings.
**3. Stage in the 10 s reason** (MCP gateway and OAuth requests alike)
- The reason now reads, for example, `timeout after 10 s (connected over IPv6 2a09:…, TLS done, no response)`.
- Other forms are `TLS not done`, `response headers received, body incomplete`, and `not connected` when no socket was assigned.
- The docs line in `agent-extensions.md` mentions the new form.
**Tests**
- Two new tests in `extensionHappyEyeballs.test.ts` cover each stage, for MCP and OAuth.
- `flyOAuthMcpFixture.test.ts` now checks the request log's fields, and that it contains no `fixture_…` value, `Bearer` or `?`.
- I fixed a test-helper problem I found: a test that mocks `net.connect` twice left a mock in place for the tests after it.
- The extension, gateway and fixture suites pass, and typecheck and source lint are clean.
- One test, `catalog stdio is callable through both selected authorized launcher policies…`, fails in this container. It also fails with the three changed source files swapped back to their HEAD versions, so it isn't caused by this change.
**Reading the rerun**
- **Request log:** if it has no entry from ProPR's Machine, the request never reached the fixture. If it has only a `start`, it reached the fixture and stalled there.
- **Probe, one family fails:** if only one family hangs from the Machine (connects but `ttfb` never arrives), I'll add the retry: a request that got no response is retried once over the other family, only for idempotent GETs, never a POST.
- **Probe, both families fail:** if both hang from the Machine but not from the runner, it's a Fly→Sprites platform path problem.
PR: #3826
Comment by: @integry (ID: 7222635441)
Model: Claude Opus 5.5
ProPR-Agent: claude/claude-opus-5-5
AI Implementation Summary
Closes #3824
Branch:
3824/claude-opus-5-5-extension-library-url-mcp-20261126-2350-bz1Commits: ✅ Changes committed (bef91c8)
AI Processing Completed
Execution Details:
Summary:
URL MCP servers now work with both stateless and stateful upstreams, and with no auth, Bearer or OAuth. The Fly smoke workflow now checks all four server types. I have not run the smoke: I don't have the Fly or Sprites credentials here. So the PR description doesn't yet have the run links, per-server modes or refresh counts the issue asks for. Someone needs to dispatch
fly-e2e.ymlwithextensionschecked, once withagent_runtime=spritesand once withfly-machines, and paste the step summaries.What's verified
URL-STATEFUL-OK-…exactly, and the session was deleted at the end.packages/core/test/extensionUpstreamSessions.test.ts, plus one inextensionOAuth.test.tsfor a stateful OAuth server through a refresh and a 401. One test runs over a real TLS connection, covering event streams and a server that loses sessions on a new connection.Gateway sessions (
packages/core/src/extensions/mcpUpstreamSessions.ts, plus changes inmcpGateway.tsandendpointPolicy.ts)initializeitself and keeps the session id inside ProPR, per run and server. It never reaches the agent and is hidden in tool output like a credential.initialize, the gateway tries the stateless 2026 protocol. The mode comes from the server's answers, not from configuration.readservers. Awriteserver's call fails instead.Behaviour changes
initializeand the initialized notification). Three existing tests that counted requests were updated.Settings and docs
Smoke workflow (
fly-e2e.yml,.github/fly-e2e/oauth-mcp-fixture.mjs)FLY_E2E_SPRITES_TOKENon Fly Machines runs too, for that Sprite.urlServers=4and a table of each server's session mode, auth, tool calls and refreshes.Choices you may want to revisit
Review digest
Risk-tiered paths
.github/fly-e2e/oauth-mcp-fixture.mjs(added, +152/−0): auth-looking path.github/workflows/fly-e2e.yml(+176/−13): CI or workflow filepackages/api/routes/extensionOAuthRoutes.ts(+13/−1): auth-looking pathpackages/api/openapi/routeDocsSystem.ts(+3/−3)packages/api/routes/extensionProfileRoutes.ts(+10/−8)packages/core/src/extensions/endpointPolicy.ts(+128/−15)packages/core/src/extensions/mcpGateway.ts(+93/−11)packages/core/src/extensions/mcpUpstreamSessions.ts(added, +256/−0)propr-ui/src/api/extensionProfilesApi.ts(+9/−2)propr-ui/src/pages/SettingsPage/AgentExtensionsSection.tsx(+10/−4)propr-ui/src/pages/SettingsPage/extensions/ExtensionServerFields.tsx(+2/−1)docs/docs/architecture/agent-runtime.md(+1/−1)docs/docs/features/agent-extensions.md(+60/−6)docs/docs/tutorials/setup-fly.md(+15/−5)docs/static/openapi/propr-api.yaml(+3/−3)packages/api/test/extensionDiscovery.test.ts(+9/−5)packages/api/test/extensionProfileRoutes.test.ts(+4/−2)packages/core/test/extensionOAuth.test.ts(+40/−0)packages/core/test/extensionProfiles.test.ts(+6/−3)packages/core/test/extensionUpstreamSessions.test.ts(added, +278/−0)packages/core/test/flyOAuthMcpFixture.test.ts(added, +109/−0)propr-ui/src/pages/SettingsPage/AgentExtensionsSection.test.tsx(+14/−1)Diff size: 22 files changed, +1,391/−84 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3824.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!
Visual preview
Discover tools on a stateful server
The server form after Discover tools on the mcptest.io stateful echo endpoint: tools are listed inside a session and the status says ProPR keeps the session for each run (mocked API response).
Full-size original
Test connections: session mode and authentication
Settings → Skills & MCP servers after Test connections: each reached URL server shows whether it is stateful or stateless and which authentication it uses (mocked API responses).
Full-size original
Live verification (29dae8b)
Sprites, extensions mode: https://github.com/integry/propr/actions/runs/45985171163 ✅. The OAuth fixture ran on a Fly Machine,
propr-e2e-oauth-<run>(Sprites runs keep the org's last Sprite for the agent). The agent's file had all 8 lines:FIGlet Copyright …SKILL-OK-<run>Echo: MCP-OK-<run>URL-STATEFUL-OK-<run>https://mcptest.io/fixtures/echo/mcp: stateful, no authURL-STATELESS-OK-<run>URL-BEARER-OK-<run>https://mcptest.io/fixtures/auth-bearer/mcp: stateful, BearerURL-OAUTH-OK-<run>DELETE. The OAuth fixture reported 1 refresh, 2 sessions opened and 2 deleted, and 0 session-not-found replies.urlServers=4. No token fragments in the log, and teardown was clean (no apps, Sprites or fixture branches left).Final live verification (head 29bd6d4)
Known issue: intermittent hang from a Fly Machine to a Sprite-hosted MCP/OAuth server
In Fly Machines mode, 3 of the last 5 runs (46011054496, 46021934633, 46027327976) hit a request from ProPR's Machine to the fixture at
*.sprites.appthat hung for exactly 10 s after TCP connected (timeout after 10 s). The runner reached the same fixture fine. The Happy Eyeballs dialer (2337a9d) rules out connect-level failures. The diagnostics added in 29bd6d4 (the fixture's request log, acurl -4/-6probe from ProPR's Machine, and connection-stage timing in the reason) run on every failure, so the next occurrence will show whether this is ProPR or the Fly → Sprites path. Real deployments that call a Sprite-hosted server from Fly Machines may hit it too.