mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-30 21:38:42 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Agent adapters use provider-specific login flows > - Codex device login needs a live pseudo-terminal (PTY), while the shared channel still uses Claude-specific names > - The old streamed-exec path does not provide the prompt transport that Codex needs > - This pull request moves Codex device login to the shared login PTY and removes the dead streamed-exec path > - The benefit is one controlled login transport with fail-closed capability checks and safer credential reads ## Linked Issues or Issue Description **Problem or motivation** Codex device login used a streamed-exec path that did not provide the required prompt transport. The shared login channel also exposed Claude-specific names outside Claude code. **Expected behavior** The host selects a fixed login command from trusted adapter data. Codex login uses the provider login PTY. Providers without that capability fail closed. **Proposed solution** Use a server-controlled session home, create and validate it as a fresh 0700 directory, read credentials from one validated descriptor, and rename shared channel names to the neutral login PTY family. **Alternatives considered** Keep the shared login PTY as the single transport. Do not keep the removed streamed-exec path because it cannot provide the required prompt transport. **Roadmap alignment** This change supports the planned login transport work. It does not add a separate roadmap item. ## What Changed - Route Codex device login through the shared login PTY transport. - Select the login command from a closed internal command key. - Carry a server-controlled session home through the launch contract. - Create and validate the session home as a fresh 0700 directory owned by the login user. - Read the credential file with descriptor-relative, no-follow path walking and final descriptor checks. - Gate the login route and run lease on the provider login PTY capability. - Rename shared channel names to the neutral login PTY family. - Remove the streamed-exec transport value, selector field, driver branch, and related tests. - Hide Codex login in the user interface when the provider lacks the login PTY capability. ## Verification - Server unit suites pass: 89/89. - Adapter-utils suites pass: 262/262. - Codex-local suites pass: 326/326. - Credential-read reader suite passes: 20/20. - Daytona login PTY suite passes: 30/30. - Device-login suites pass: 56/56. - TypeScript checks pass for server, adapter-utils, and UI. - GitHub Actions must pass after pull request creation. - Greptile review must reach 5/5 with no open P2 findings, recommendations, or follow-ups. ## Risks - Providers without a login PTY capability lose Codex login support by design. - The credential read rejects invalid ownership, mode, type, path, and size. - The launch-time sandbox directory race remains outside the threat model because the login runs inside the sandbox and a hostile sandbox already controls its credential. ## Model Used OpenAI Codex, GPT-5, tool use and code review assistance. The exact context window and reasoning mode are not exposed by the runtime. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>
123 lines
3.3 KiB
TypeScript
123 lines
3.3 KiB
TypeScript
export type {
|
|
AdapterAgent,
|
|
AdapterRuntime,
|
|
UsageSummary,
|
|
AdapterBillingType,
|
|
AdapterRuntimeServiceReport,
|
|
AdapterExecutionResult,
|
|
AdapterInvocationMeta,
|
|
AdapterRuntimeEvent,
|
|
AdapterRuntimeMcpServer,
|
|
AdapterRuntimeMcpAccess,
|
|
AdapterExecutionContext,
|
|
AdapterEnvironmentCheckLevel,
|
|
AdapterEnvironmentCheck,
|
|
AdapterEnvironmentTestStatus,
|
|
AdapterEnvironmentTestResult,
|
|
AdapterEnvironmentTestContext,
|
|
AdapterSkillSyncMode,
|
|
AdapterSkillState,
|
|
AdapterSkillOrigin,
|
|
AdapterSkillEntry,
|
|
AdapterSkillSnapshot,
|
|
AdapterSkillContext,
|
|
AdapterSessionCodec,
|
|
AdapterModel,
|
|
AdapterModelProfileKey,
|
|
AdapterModelProfileDefinition,
|
|
HireApprovedPayload,
|
|
HireApprovedHookResult,
|
|
ConfigFieldOption,
|
|
ConfigFieldSchema,
|
|
AdapterConfigSchema,
|
|
AdapterRuntimeCommandSpec,
|
|
AcpTargetDescriptor,
|
|
ServerAdapterModule,
|
|
QuotaWindow,
|
|
ProviderQuotaResult,
|
|
TranscriptEntry,
|
|
StdoutLineParser,
|
|
CLIAdapterModule,
|
|
CreateConfigValues,
|
|
} from "./types.js";
|
|
export type {
|
|
SessionCompactionPolicy,
|
|
NativeContextManagement,
|
|
AdapterSessionManagement,
|
|
ResolvedSessionCompactionPolicy,
|
|
} from "./session-compaction.js";
|
|
export {
|
|
ADAPTER_SESSION_MANAGEMENT,
|
|
LEGACY_SESSIONED_ADAPTER_TYPES,
|
|
getAdapterSessionManagement,
|
|
readSessionCompactionOverride,
|
|
resolveSessionCompactionPolicy,
|
|
hasSessionCompactionThresholds,
|
|
} from "./session-compaction.js";
|
|
export {
|
|
REDACTED_HOME_PATH_USER,
|
|
redactHomePathUserSegments,
|
|
redactHomePathUserSegmentsInValue,
|
|
redactTranscriptEntryPaths,
|
|
} from "./log-redaction.js";
|
|
export {
|
|
REDACTED_COMMAND_TEXT_VALUE,
|
|
redactCommandText,
|
|
redactDiagnosticText,
|
|
} from "./command-redaction.js";
|
|
export { buildSandboxNpmInstallCommand } from "./sandbox-install-command.js";
|
|
export {
|
|
buildAdapterEnvConfig,
|
|
parseEnvBindings,
|
|
parseEnvVars,
|
|
} from "./env-bindings.js";
|
|
export { createRuntimeProgressReporter } from "./runtime-progress.js";
|
|
export type {
|
|
RuntimeProgressSink,
|
|
RuntimeProgressPhase,
|
|
RuntimeProgressDirection,
|
|
RuntimeProgressTarget,
|
|
RuntimeProgressReporter,
|
|
RuntimeProgressReporterOptions,
|
|
RuntimeStatusPhase,
|
|
RuntimeStatusSink,
|
|
RuntimeStatusUpdate,
|
|
} from "./runtime-progress.js";
|
|
export { inferOpenAiCompatibleBiller } from "./billing.js";
|
|
export {
|
|
ADAPTER_LOGIN_PANEL_MODES,
|
|
ADAPTER_LOGIN_TIMEOUT_POLICIES,
|
|
ADAPTER_LOGIN_COMPLETION_CLAIMS,
|
|
assertValidAdapterLoginCapability,
|
|
validateAdapterLoginCapability,
|
|
} from "./login-capability.js";
|
|
export type {
|
|
AdapterLoginPanelMode,
|
|
AdapterLoginTimeoutPolicy,
|
|
AdapterLoginCompletionClaim,
|
|
AdapterLoginPrompt,
|
|
AdapterLoginCompletionContext,
|
|
AdapterLoginCapability,
|
|
} from "./login-capability.js";
|
|
export { raceLoginRunnerExit } from "./login-runner-lifecycle.js";
|
|
export type {
|
|
LoginRunnerOutcome,
|
|
LoginRunnerResult,
|
|
LoginRunnerLog,
|
|
LoginRunnerLifecycleOptions,
|
|
LoginRunnerDisposable,
|
|
LoginRunnerRaceResult,
|
|
} from "./login-runner-lifecycle.js";
|
|
// Keep the root adapter-utils entry browser-safe because the UI imports it.
|
|
// The sandbox callback bridge stays available via its dedicated subpath export.
|
|
export type {
|
|
SandboxCallbackBridgeRequest,
|
|
SandboxCallbackBridgeResponse,
|
|
SandboxCallbackBridgeAsset,
|
|
SandboxCallbackBridgeDirectories,
|
|
SandboxCallbackBridgeRouteRule,
|
|
SandboxCallbackBridgeQueueClient,
|
|
SandboxCallbackBridgeWorkerHandle,
|
|
StartedSandboxCallbackBridgeServer,
|
|
} from "./sandbox-callback-bridge.js";
|