Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

fix(phone-conversation): resolve WORKSPACE_DIR via resolveWorkspace() not repo root - #107

Open
jgluck96 wants to merge 1 commit into
mainfrom
fix/conversation-server-workspace-dir
Open

jgluck96 wants to merge 1 commit into
mainfrom
fix/conversation-server-workspace-dir

Conversation

@jgluck96

@jgluck96 jgluck96 commented Jun 4, 2026

Copy link
Copy Markdown

Summary

conversation-server.ts had:

const WORKSPACE_DIR = process.env.SUTANDO_WORKSPACE || join(dirname(...), '../../..');

startup.sh never exports SUTANDO_WORKSPACE, so the fallback was always the repo root.

Impact — all of these landed in <repo>/ instead of ~/.sutando/workspace/:

  • TASKS_DIR (tasks/) — phone tasks written to repo root, never picked up by Claude
  • RESULTS_DIR (results/) — phone results written to repo root, DMs never delivered
  • conversation.log — voice-agent.ts reads this via statePath('conversation.log') = <workspace>/conversation.log; phone side wrote to <repo>/conversation.log → cross-agent context was silently empty for every phone call

discord-voice-server.ts (sister file) already uses resolveWorkspace() correctly — this aligns conversation-server.ts to the same pattern.

Fix

  • Import resolveWorkspace() from ../../../src/workspace_default.js
  • WORKSPACE_DIR = resolveWorkspace() → ~/.sutando/workspace/
  • Add REPO_DIR for the one call that legitimately needs the repo path (src/scan-call-logs.py)

Test plan

  • npx tsc --noEmit — clean
  • npm test — 240/240 pass
  • Phone call: task file appears in ~/.sutando/workspace/tasks/ (not repo root)
  • After call: conversation.log appended in ~/.sutando/workspace/ → voice-agent has phone context

🤖 Generated with Claude Code

… not repo root

WORKSPACE_DIR fell back to join(dirname(__file__), '../../..') = repo root
when SUTANDO_WORKSPACE was unset. startup.sh never exports SUTANDO_WORKSPACE,
so the fallback was always used.

Impact: phone task files (TASKS_DIR), results (RESULTS_DIR), and
conversation.log all landed in <repo>/ instead of ~/.sutando/workspace/.
voice-agent reads conversation.log via statePath('conversation.log') =
<workspace>/conversation.log, so cross-agent context was silently empty
for every phone call.

Fix: import resolveWorkspace() (already used by discord-voice-server.ts
for the same purpose); add REPO_DIR = dirname(__file__)/../../.. for
the one call that legitimately needs the repo path (scan-call-logs.py).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@bassilkhilo-ag2 bassilkhilo-ag2 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Correctly splits WORKSPACE_DIR (resolveWorkspace) from REPO_DIR (dirname/import.meta.url) in conversation-server — scan-call-logs.py is a code-adjacent path so REPO_DIR is right there.

@bassilkhilo-ag2 bassilkhilo-ag2 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Correctly splits WORKSPACE_DIR (resolveWorkspace) from REPO_DIR (dirname/import.meta.url) in conversation-server — scan-call-logs.py is a code-adjacent path so REPO_DIR is right there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants