Skip to content

The agent that grows with you

fix(desktop): document connect-on-demand origin, add fallback-profiles integration test

chelsealonga92859675886
diff --git a/apps/desktop/electron/plugin-profile-routes.test.ts b/apps/desktop/electron/plugin-profile-routes.test.ts
index bcd7fbbca85..b84d4a02491 100644
--- a/apps/desktop/electron/plugin-profile-routes.test.ts
+++ b/apps/desktop/electron/plugin-profile-routes.test.ts
@@ -278,6 +278,18 @@ describe('localRouteFallbackProfiles', () => {
it('does not synthesize local routes after a successful local enumeration', () => {
expect(localRouteFallbackProfiles([], 'local', ['default'], false)).toEqual([])
})
+
+ it('does not synthesize local routes for a deferred connect-on-demand enumeration', () => {
+ expect(
+ localRouteFallbackProfiles([], 'local', ['default'], isLocalEnumerationFailure('connect-on-demand'))
+ ).toEqual([])
+ })
+
+ it('synthesizes local routes for a genuine local enumeration error', () => {
+ expect(
+ localRouteFallbackProfiles([], 'local', ['default'], isLocalEnumerationFailure('ECONNREFUSED'))
+ ).toEqual(['default'])
+ })
})
describe('undialedSshRouteSeeds', () => {
diff --git a/apps/desktop/electron/plugin-profile-routes.ts b/apps/desktop/electron/plugin-profile-routes.ts
index 576719aae63..d7024cea9be 100644
--- a/apps/desktop/electron/plugin-profile-routes.ts
+++ b/apps/desktop/electron/plugin-profile-routes.ts
@@ -53,7 +53,10 @@ interface BuildOpaqueProfileRoutesOptions {
/** A 'connect-on-demand' local enumeration was intentionally deferred, not
* failed — it must not be treated as a failure or Bot Mode will synthesize
- * cached local rows on remote-only workspaces where local was never dialed. */
+ * cached local rows on remote-only workspaces where local was never dialed.
+ * The sentinel is set by `enumerateRegistryAgentSources` in main.ts when
+ * `shouldDeferLocalEnumeration` (connection-registry.ts) defers the local
+ * source. */
export function isLocalEnumerationFailure(error?: string): boolean {
return Boolean(error) && error !== 'connect-on-demand'
}