fix(t-paliad-155): spawn claude pane in paliad repo root for project MCPs
claude in the shim's tmux pane was being launched from $HOME, so it
loaded only global MCPs (mai, mai-memory, mgeo) and missed the
project-scoped Supabase MCP at /home/m/dev/paliad/.mcp.json. SKILL.md's
SQL recipes therefore had no DB tool — m saw 'no DB access' on every
real Paliadin turn.
Fix: tmux new-window -c $CLAUDE_CWD when spawning the pane. New env
var PALIADIN_REMOTE_CWD (default /home/m/dev/paliad) lets a host
override the path if the repo lives elsewhere; shim fast-fails with
exit 3 if the directory doesn't exist.
CLAUDE.md updated. Verified by spawning a fresh session via the shim
and inspecting #{pane_current_path}.
This commit is contained in:
@@ -31,6 +31,11 @@ umask 077
|
||||
|
||||
readonly RESPONSE_DIR="${PALIADIN_RESPONSE_DIR:-/tmp/paliadin}"
|
||||
readonly TIMEOUT_S="${PALIADIN_TIMEOUT_S:-60}"
|
||||
# Working directory for the claude pane. Must be the paliad repo root so
|
||||
# claude picks up .mcp.json (project-scoped Supabase MCP) — without it,
|
||||
# the SKILL.md SQL recipes fail with no DB tool. Override via env var if
|
||||
# the repo lives elsewhere on this host.
|
||||
readonly CLAUDE_CWD="${PALIADIN_REMOTE_CWD:-/home/m/dev/paliad}"
|
||||
readonly PANE_READY_S=60 # max wait for claude pane to settle
|
||||
readonly TURN_ID_RE='^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'
|
||||
# Session names are constructed by the Go side as `paliad-paliadin-<userid8>`;
|
||||
@@ -95,7 +100,11 @@ ensure_pane() {
|
||||
log_err "claude CLI not found in PATH"
|
||||
exit 3
|
||||
fi
|
||||
idx=$(tmux new-window -t "$session" -n claude-paliadin -P -F '#{window_index}' claude)
|
||||
if [[ ! -d "$CLAUDE_CWD" ]]; then
|
||||
log_err "claude cwd $CLAUDE_CWD does not exist — set PALIADIN_REMOTE_CWD"
|
||||
exit 3
|
||||
fi
|
||||
idx=$(tmux new-window -c "$CLAUDE_CWD" -t "$session" -n claude-paliadin -P -F '#{window_index}' claude)
|
||||
target="$session:$idx"
|
||||
|
||||
# Wait for claude to settle. Matches Go waitForPaneReady (paliadin.go).
|
||||
|
||||
Reference in New Issue
Block a user