Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

fix(relay): keep read diagnostics off credential services [H17,H21]

Corey Olson7c7731bc9856
diff --git a/src/cli-sync.js b/src/cli-sync.js
index c80c742f..5f3afb3c 100644
--- a/src/cli-sync.js
+++ b/src/cli-sync.js
@@ -58,7 +58,7 @@ function localFirstLink(io) {
/** Keep the existing device-key repair warning on local reads without acquiring a relay lock or making a request. */
function tellLocalKeyDiagnostic(io, link) {
if (KEY_WARNED_COMMANDS.has(io)) return;
- try { readBoardKey(link.board); }
+ try { readBoardKey(link.board, { legacyKeychain: false }); }
catch (error) {
if (!(error instanceof Refused) || error.code !== 'RELAY_KEY_MISSING') throw error;
KEY_WARNED_COMMANDS.add(io);
diff --git a/src/relay-key.js b/src/relay-key.js
index ac309d32..0500730e 100644
--- a/src/relay-key.js
+++ b/src/relay-key.js
@@ -73,8 +73,13 @@ function removeKeychainValue(service, id) {
if (removed.status !== 0 && !absent) throw new Refused('RELAY_KEYCHAIN', 'unlock the system keychain to finish moving this board key');
}
-/** Read device storage first; a CI or cloud session then uses its environment key, and any other session migrates a legacy keychain value before the environment fallback. */
-export function readBoardKey(boardId) {
+/**
+ * Read device storage first, then the environment or a legacy keychain. Transport keeps migration enabled;
+ * foreground local-read diagnostics opt out so a missing file cannot launch a blocking credential helper.
+ * @param {string} boardId - The persistent board identity.
+ * @param {{legacyKeychain?: boolean}} options - Whether to probe and migrate a legacy credential service.
+ */
+export function readBoardKey(boardId, { legacyKeychain = true } = {}) {
const id = identity(boardId);
const file = keyFile(id);
if (existsSync(file)) {
@@ -96,7 +101,7 @@ export function readBoardKey(boardId) {
// a keychain or writes a key file [E18]. A person's machine still migrates a legacy keychain value first.
const environmentSession = process.env.PULLBOARD_RELAY_TOKEN !== undefined && process.env.PULLBOARD_RELAY_KEY !== undefined;
if (environmentSession) return decodeBoardKey(process.env.PULLBOARD_RELAY_KEY);
- const service = keychain();
+ const service = legacyKeychain ? keychain() : null;
if (service) {
const args = service === 'security'
? ['find-generic-password', '-a', id, '-s', 'pullboard.board-key', '-w']