Skip to content

fix(commands): resolve /context JSONL path without daemon cwd (#229) - #233

Merged
TerrysPOV merged 3 commits into
moazbuilds:masterfrom
rudi193-cmd:fix/issue-229-context-jsonl-path
Jun 28, 2026
Merged

fix(commands): resolve /context JSONL path without daemon cwd (#229)#233
TerrysPOV merged 3 commits into
moazbuilds:masterfrom
rudi193-cmd:fix/issue-229-context-jsonl-path

Conversation

@rudi193-cmd

Copy link
Copy Markdown
Contributor

Fixes #229. Adds findSessionJsonlPath in src/sessionFiles.ts; wires telegram/discord /context and ui sessions/usage. Tests: tests/session-files.test.ts (5 pass).

@rudi193-cmd

Copy link
Copy Markdown
Contributor Author

Note on the failing claude-review check: this is failing before review runs because the action has no Claude credential available:

Failed to authenticate. API Error: 401 Invalid authentication credentials
ANTHROPIC_API_KEY:

The patch test itself passes locally:

node --experimental-strip-types --test tests/session-files.test.ts
# 5 pass, 0 fail

So this PR is blocked on the repo's Claude Code Review workflow credentials / rerun, not on a code failure from this change.

@TerrysPOV TerrysPOV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code review

Found 1 issue:

  1. existsSync is removed from the imports but still called inside extractVoiceDirectives. PR 233 drops import { existsSync } from "node:fs"; from the top of src/commands/telegram.ts, but line 623 still calls existsSync(p) when filtering [voice:/path] directives in responses. There is no tsc/typecheck job in CI to catch this — it lands as a ReferenceError the first time a Telegram-handled response contains a voice directive.

import { resetSession, resetFallbackSession, peekSession } from "../sessions";
import { peekThreadSession, removeThreadSession } from "../sessionManager";
import { readFile } from "node:fs/promises";
import { findSessionJsonlPath } from "../sessionFiles";
import { resolveSkillPrompt, listSkills } from "../skills";
import { mkdir } from "node:fs/promises";
import { extname, join } from "node:path";
import { isWizardTrigger, hasActiveWizard, handleWizardInput } from "./plugin-wizard";

const cleanedText = text
.replace(VOICE_DIRECTIVE_RE, (_match, path) => {
const p = String(path).trim();
if (p && existsSync(p)) voicePaths.push(p);
return "";
})
.replace(/[ \t]+\n/g, "\n")

Co-authored-by: Cursor <cursoragent@cursor.com>
@rudi193-cmd

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in 0c9cfea.

Restored import { existsSync } from "node:fs" in src/commands/telegram.ts so extractVoiceDirectives can still filter [voice:/path] directives without a runtime ReferenceError.

Added a small import/regression test in tests/session-files.test.ts.

node --experimental-strip-types --test tests/session-files.test.ts
# 6 pass, 0 fail

Ready for another look when you have a moment.

@rudi193-cmd

Copy link
Copy Markdown
Contributor Author

@TerrysPOV friendly re-review ping — the existsSync import you flagged is restored in 0c9cfea (extractVoiceDirectives still filters [voice:/path] directives). claude-review is green and the branch is mergeable. Re-requested your review; happy to adjust if anything else stands out.

Maintainer commit to satisfy plugin-version-guard and
marketplace-version-guard CI checks for PR moazbuilds#233.

@TerrysPOV TerrysPOV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Prior blocker resolved — existsSync import restored at src/commands/telegram.ts:10.

Maintainer-committed the plugin + marketplace version bumps to 1.0.40 in c2753ba so plugin-version-guard and marketplace-version-guard pass — please run bun run bump:plugin-version + bun run bump:marketplace-version yourself on future PRs.

Approving.

@TerrysPOV
TerrysPOV merged commit a650d43 into moazbuilds:master Jun 28, 2026
4 checks passed
rudi193-cmd added a commit to rudi193-cmd/claudeclaw that referenced this pull request Jun 28, 2026
Required by plugin-version-guard / marketplace-version-guard — master
advanced to 1.0.39 after moazbuilds#233 merged, matching this branch. (moazbuilds#234)
TerrysPOV added a commit to rudi193-cmd/claudeclaw that referenced this pull request Jul 19, 2026
Maintainer commit — master reached 1.0.40 via moazbuilds#233, so the branch's
1.0.40 bump was a no-op. Re-bump to 1.0.41 to satisfy
plugin-version-guard and marketplace-version-guard for PR moazbuilds#234.
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.

/Context command broken from recent claude update

2 participants