Skip to content

fix(voice-context): read calls.jsonl from workspace, not repo root - #1228

Closed
bassilkhilo-ag2 wants to merge 1 commit into
sonichi:mainfrom
bassilkhilo-ag2:fix/voice-context-calls-workspace-path
Closed

bassilkhilo-ag2 wants to merge 1 commit into
sonichi:mainfrom
bassilkhilo-ag2:fix/voice-context-calls-workspace-path

Conversation

@bassilkhilo-ag2

Copy link
Copy Markdown
Collaborator

Problem

buildVoiceAgentContext() in src/voice-context.ts always omits the RECENT PHONE CALLS section, even after calls have been made. The bug: it reads from REPO_DIR/results/calls/calls.jsonl but calls are written to WORKSPACE_DIR/results/calls/calls.jsonl by skills/phone-conversation/scripts/conversation-server.ts (line 1076) via resolveWorkspace().

REPO_DIR  = /Users/…/sutando/                          ← never has calls
WORKSPACE_DIR = ~/.sutando/workspace/                  ← where calls actually land

Fix

One-line change: join(REPO_DIR, …) → join(WORKSPACE_DIR, …) on src/voice-context.ts:69. WORKSPACE_DIR was already resolved on line 19 of the same file via resolveWorkspace().

Tests

Adds tests/voice-context.test.ts (15 tests):

  • buildVoiceAgentContext — no memory files, user profile, profile truncation, phone calls (caller/to/topic/malformed), missing calls file
  • buildSutandoSystemPrompt — base output, CLAUDE.md inclusion, memory file inclusion, frontmatter stripping

All 15 pass against this fix; 3 were failing against origin/main.

Test plan

  • npx tsx --test tests/voice-context.test.ts → 15/15 pass
  • Manual: cat ~/.sutando/workspace/results/calls/calls.jsonl has entries; buildVoiceAgentContext() now includes them

🤖 Generated with Claude Code

@VasiliyRad VasiliyRad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Real fix is buried under bundled junk. The actual change is 1 line in src/voice-context.ts + a 178-line test — read calls.jsonl from $SUTANDO_WORKSPACE instead of repo root. That sounds correct and useful.

But this PR bundles the same 4 files I've flagged on #1196/#1194/#1225/#1226/#1227 this session: build_log.md (+114), src/health-check.py (+14/-2), tests/health-check-bridge-multi-pid.test.py (+88), tests/sync-memory-memory-dir.test.sh (+284).

Strip those 4 files and I'll approve immediately — the real fix is good. Reviewing 800+ lines of cruft to find a one-line fix is the exact problem I called out on #1196.

@bassilkhilo-ag2

Copy link
Copy Markdown
Collaborator Author

Rebased onto origin/main (dropped the 4 local-only commits that were contaminating the diff). The branch now has exactly 1 commit — the actual change. Sorry for the noise.

@bassilkhilo-ag2

Copy link
Copy Markdown
Collaborator Author

Branch is now clean — only src/voice-context.ts + tests/voice-context.test.ts in the diff. The 4-file bundle (build_log.md, health-check.py, two test files) has been rebased out. Could you take another look?

phone-conversation/scripts/conversation-server.ts writes calls to
$WORKSPACE/results/calls/calls.jsonl via resolveWorkspace(). voice-context.ts
was reading from REPO_DIR/results/calls/calls.jsonl — a path that never exists
in production — so RECENT PHONE CALLS was always omitted from voice context.

Fixes by reading from WORKSPACE_DIR which resolves identically to what
conversation-server writes.

Adds tests/voice-context.test.ts (15 tests) covering buildVoiceAgentContext
and buildSutandoSystemPrompt with memory files, profile truncation, phone
call entries, and frontmatter stripping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bassilkhilo-ag2
bassilkhilo-ag2 force-pushed the fix/voice-context-calls-workspace-path branch from 907b512 to e60d0c7 Compare May 27, 2026 03:39
@bassilkhilo-ag2

Copy link
Copy Markdown
Collaborator Author

Rebased on clean origin/main — bundled files stripped, single-commit diff. Re-requesting review.

@bassilkhilo-ag2

Copy link
Copy Markdown
Collaborator Author

Closing per owner instruction — autonomous PR creation halted.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants