Repository navigation
feat(cli): distinguish cross-node agents from missing agents on attach 404 #1480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bebd31d
625d613
d9dc3c6
1611ec7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,7 @@ import { | |
| type BrokerConnection, | ||
| } from '../lib/broker-connection.js'; | ||
| import { defaultExit, runSignalHandler } from '../lib/exit.js'; | ||
| import { resolveFleetHint } from '../lib/fleet-hint.js'; | ||
| import { | ||
| createBrokerClient, | ||
| mapBrokerSdkFailure, | ||
|
|
@@ -188,6 +189,12 @@ export interface DriveDependencies { | |
| name: string, | ||
| deps: AttachSnapshotDeps | ||
| ) => ReturnType<typeof captureAndRenderSnapshot>; | ||
| /** | ||
| * Best-effort workspace lookup for improving cross-node 404 messages. | ||
| * Defaults to `resolveFleetHint` from `fleet-hint.ts`. Tests inject a stub | ||
| * to avoid network calls. | ||
| */ | ||
| fleetHint?: (name: string) => Promise<string | null>; | ||
| /** Stdin handle — defaults to `process.stdin`. */ | ||
| stdin: DriveStdin; | ||
| /** Local terminal size source — defaults to `process.stdout`. */ | ||
|
|
@@ -258,6 +265,7 @@ function withDefaults(overrides: Partial<DriveDependencies> = {}): DriveDependen | |
| exit: defaultExit, | ||
| fetch: fetchFn, | ||
| captureAndRenderSnapshot, | ||
| fleetHint: resolveFleetHint, | ||
| stdin: process.stdin as DriveStdin, | ||
| terminal: { | ||
| getSize: () => { | ||
|
|
@@ -1334,7 +1342,7 @@ function runDriveSessionLoop(state: DriveSessionState, deps: DriveDependencies): | |
| const snapshot = await deps.captureAndRenderSnapshot( | ||
| { url: connection.url, apiKey: connection.apiKey }, | ||
| name, | ||
| { fetch: deps.fetch, writeChunk: captureWrite } | ||
| { fetch: deps.fetch, writeChunk: captureWrite, fleetHint: deps.fleetHint } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: switchInboundDeliveryModeOrAbort emits its own 'no agent named ...' message and returns before captureAndRenderSnapshot runs on a 404, so the fleetHint threaded through at this call site never gets a chance to run for the mode-switch preflight path in passthrough (and the same gap applies to drive's preflight). Prompt for AI agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [cross-node-attach-lead-0811 via Chief] Fixed — commit d9dc3c6 (same fix as coderabbitai Threads 2 & 3). switchInboundDeliveryModeOrAbort now accepts fleetHint in its deps and uses it in the 404 branch, so drive and passthrough preflights emit the cross-node message. Regression tests added for both drive and passthrough. |
||
| ); | ||
| if (settled) return; | ||
| switch (snapshot.status) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.