Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/services/SummaryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@

Return ONLY a JSON array in the same order: [{"title":"...","description":"...","lastMessage":"..."}]`;

const backend = this._cliBackend!;

Check warning on line 171 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (macos-latest, 20)

Forbidden non-null assertion

Check warning on line 171 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (ubuntu-latest, 20)

Forbidden non-null assertion

Check warning on line 171 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (ubuntu-latest, 22)

Forbidden non-null assertion

Check warning on line 171 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (macos-latest, 22)

Forbidden non-null assertion

Check warning on line 171 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (windows-latest, 22)

Forbidden non-null assertion

Check warning on line 171 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (windows-latest, 20)

Forbidden non-null assertion

// BUG8b: For Claude CLI, pass prompt as a positional argument — stdin
// piping is unreliable (CLI may not read it, producing empty output).
Expand All @@ -178,7 +178,7 @@
: ['exec', '--ephemeral', '--skip-git-repo-check', '-'];

let stdout = '';
let stderr = '';

Check warning on line 181 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (macos-latest, 20)

'stderr' is assigned a value but never used

Check warning on line 181 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (ubuntu-latest, 20)

'stderr' is assigned a value but never used

Check warning on line 181 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (ubuntu-latest, 22)

'stderr' is assigned a value but never used

Check warning on line 181 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (macos-latest, 22)

'stderr' is assigned a value but never used

Check warning on line 181 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (windows-latest, 22)

'stderr' is assigned a value but never used

Check warning on line 181 in src/services/SummaryService.ts

View workflow job for this annotation

GitHub Actions / build-and-test (windows-latest, 20)

'stderr' is assigned a value but never used

// BUG8b: spawn() does not support a `timeout` option (only exec/execFile
// do). Use AbortController to enforce the timeout instead.
Expand All @@ -188,7 +188,6 @@
const child = spawn(backend.path, args, {
cwd: os.tmpdir(),
env: CHILD_ENV,
shell: process.platform === 'win32', // required to execute .cmd/.bat files on Windows
signal: ac.signal,
});

Expand Down Expand Up @@ -266,8 +265,7 @@
const binPath = stdout.trim().split('\n')[0].trim();
const child = spawn(binPath, ['--version'], {
timeout: CLI_CHECK_TIMEOUT_MS,
env: CHILD_ENV,
shell: isWindows // required to execute .cmd/.bat files on Windows
env: CHILD_ENV
});
child.on('error', () => resolve(undefined));
child.on('close', (code) => resolve(code === 0 ? binPath : undefined));
Expand Down
24 changes: 18 additions & 6 deletions standalone/StandaloneMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export class StandaloneMessageHandler {

/** Open a workspace folder in an editor (VSCode, Cursor, etc.). */
private openInEditor(cmd: string, cwd: string) {
execFile(cmd, [cwd], { shell: process.platform === 'win32' }, (err) => {
execFile(cmd, [cwd], (err) => {
if (err) {
console.error(`Claudine: Failed to open ${cmd}`, err);
this._send({ type: 'error', message: `Failed to open ${cmd}: ${err.message}` });
Expand All @@ -376,11 +376,23 @@ export class StandaloneMessageHandler {
/** Resume a Claude Code conversation in a terminal emulator. */
private openInTerminal(cwd: string, sessionId: string) {
const platform = process.platform;
// Strip Node.js debugger variables that interfere with child processes (mainly relevant to
// VS Code debug sessions). NODE_OPTIONS may carry debugger bootstrap flags (--require) that
// claude's embedded Node can't resolve.
const env = { ...process.env };
delete env['NODE_OPTIONS'];
// Use a minimal env to avoid leaking secrets and stripping Node.js debugger
// variables (e.g. NODE_OPTIONS) that interfere with child processes.
const env: NodeJS.ProcessEnv = {
PATH: process.env.PATH,
HOME: process.env.HOME,
LANG: process.env.LANG,
TERM: process.env.TERM,
// Windows: needed for terminal emulators to locate config dirs and resolve .cmd files
...(platform === 'win32' && {
APPDATA: process.env.APPDATA,
USERPROFILE: process.env.USERPROFILE,
PATHEXT: process.env.PATHEXT,
SystemRoot: process.env.SystemRoot,
TEMP: process.env.TEMP,
TMP: process.env.TMP,
}),
};

const resumeCmd = `claude --resume ${sessionId}`;

Expand Down
Loading