mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-20 18:26:40 +01:00
feat(ssh): use the agent AI account in new environments (#21248)
Use the agent-selected AI account for new SSH environments. Preserve
remote-machine authentication for existing environments and expose it as
an advanced option. Keep managed credentials private while preserving
supported conversation state and credential refreshes across turns.
Validated with focused route, adapter, lifecycle, and real-process tests;
final CI passed on d634944df1.
Greptile Apex reviewed that revision at 5/5 with no unresolved threads.
External neutral security reports remain documented in the pull request.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
2a8b485140
commit
12aa08721c
77 files changed
+6115
-3898
No files matched your search
@@ -233,6 +233,7 @@ import type { NativeRunnerAttachmentDownload, NativeRunnerAttachmentStage } from
|
||||
import { discoverRemoteExecutable, parseRemoteExecutableCandidate } from "./codex-model-fallback.js";
|
||||
export { parseRemoteExecutableCandidate } from "./codex-model-fallback.js";
|
||||
import type { CommandManagedRuntimeRunner } from "@paperclipai/adapter-utils/command-managed-runtime";
|
||||
import { readRemoteUserHome } from "./remote-user-home.js";
|
||||
import { NativeRunnerIngressAcquisitionError, prepareNativeRemoteRunner, createNativeRunnerExecutionDriver, resolveRemoteRunnerTransportMode } from "./native-runner-execution-driver.js";
|
||||
import type { Db } from "@paperclipai/db";
|
||||
import {
|
||||
@@ -18048,14 +18049,7 @@ async function createRunnerdBackendWithinSessionClaim(
|
||||
delete effectiveRunnerEnvironmentBase.PAPERCLIP_RUNNER_PREPARED_HARNESS_HOME;
|
||||
if (preconfiguredHome) {
|
||||
if (remoteCommandRunner) {
|
||||
const discovered = await remoteCommandRunner.execute({
|
||||
command: "sh", args: ["-c", 'getent passwd "$(id -u)" | cut -d: -f6'],
|
||||
bypassSession: true, timeoutMs: 10_000,
|
||||
});
|
||||
const home = discovered.stdout.trim();
|
||||
if (discovered.exitCode !== 0 || discovered.timedOut || !home.startsWith("/") || /[\0\r\n]/.test(home)) {
|
||||
throw new Error("runner_preconfigured_remote_home_unavailable");
|
||||
}
|
||||
const home = await readRemoteUserHome(remoteCommandRunner);
|
||||
// Paths from the controller's account cannot select a remote account's config.
|
||||
const hostPathKeys = new Set(["CODEX_HOME", "CLAUDE_CONFIG_DIR", "XDG_CONFIG_HOME", "XDG_DATA_HOME", "XDG_CACHE_HOME"]);
|
||||
const configured = configuredEnvironment(effectiveRunnerEnvironmentBase);
|
||||
|
||||
Reference in new issue
Block a user