Skip to content

Commit 922b4a7

Browse files
chore: address CodeRabbit review
- Make opencode-smoke tmux script resolve OPENCODE_BIN from env//home/anandpant/command -v - Adjust FOUNDRY_TOKEN guidance strings to single-quote friendly and <=100 chars
1 parent 94ce2a9 commit 922b4a7

2 files changed

Lines changed: 23 additions & 5 deletions

File tree

scripts/dev/opencode-smoke-tmux.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,23 @@ if tmux -L "${SOCKET_NAME}" has-session -t "${SESSION_NAME}" 2>/dev/null; then
2323
SESSION_NAME="${SESSION_NAME}-${TS}"
2424
fi
2525

26+
opencode_bin=""
27+
if [[ -n "${OPENCODE_BIN:-}" ]]; then
28+
opencode_bin="${OPENCODE_BIN}"
29+
elif [[ -x "${HOME}/.opencode/bin/opencode" ]]; then
30+
opencode_bin="${HOME}/.opencode/bin/opencode"
31+
else
32+
opencode_bin="$(command -v opencode || true)"
33+
fi
34+
35+
if [[ -z "${opencode_bin}" ]]; then
36+
echo "[ERROR] opencode binary not found. Install opencode or set OPENCODE_BIN." >&2
37+
exit 1
38+
fi
39+
2640
CMD="cd '$(pwd)' && \
2741
export OPENCODE_SMOKE_REPO='${REPO_PATH}' && \
28-
export OPENCODE_BIN='/home/anandpant/.opencode/bin/opencode' && \
42+
export OPENCODE_BIN='${opencode_bin}' && \
2943
${FOUNDRY_URL:+export OPENCODE_SMOKE_FOUNDRY_URL='${FOUNDRY_URL}' && }\
3044
echo '[smoke] running vitest smoke...' && \
3145
bun test src/__tests__/opencodeSmoke.test.ts; \

src/palantir-mcp/commands.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ export async function setupPalantirMcp(worktree: string, rawArgs: string): Promi
8585
'',
8686
'palantir-mcp tool discovery requires a token. Export FOUNDRY_TOKEN and retry.',
8787
'',
88-
"Tip: if `echo $FOUNDRY_TOKEN` prints a value but this still errors, it's likely not exported.",
89-
'Run `export FOUNDRY_TOKEN` (or set `export FOUNDRY_TOKEN=...` in your shell secrets) and retry.',
88+
'Tip: if `echo $FOUNDRY_TOKEN` prints a value but this still errors, it is likely ' +
89+
'not exported.',
90+
'Run `export FOUNDRY_TOKEN` (or set `export FOUNDRY_TOKEN=...` in your shell ' +
91+
'secrets) and retry.',
9092
].join('\n');
9193
}
9294

@@ -172,8 +174,10 @@ export async function rescanPalantirMcpTools(worktree: string): Promise<string>
172174
'',
173175
'palantir-mcp tool discovery requires a token. Export FOUNDRY_TOKEN and retry.',
174176
'',
175-
"Tip: if `echo $FOUNDRY_TOKEN` prints a value but this still errors, it's likely not exported.",
176-
'Run `export FOUNDRY_TOKEN` (or set `export FOUNDRY_TOKEN=...` in your shell secrets) and retry.',
177+
'Tip: if `echo $FOUNDRY_TOKEN` prints a value but this still errors, it is likely ' +
178+
'not exported.',
179+
'Run `export FOUNDRY_TOKEN` (or set `export FOUNDRY_TOKEN=...` in your shell ' +
180+
'secrets) and retry.',
177181
].join('\n');
178182
}
179183

0 commit comments

Comments
 (0)