fix: pass cwd to sendMessage so Claude knows the project directory on resume

This commit is contained in:
neken
2026-04-10 18:02:30 +05:00
parent 6afb703a85
commit eaa542b11f
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ export function createMessageHandler(
await ctx.replyWithChatAction("typing");
// Run Claude call without blocking the bot's event loop
claude.sendMessage(text, session.sessionId).then(async (result) => {
claude.sendMessage(text, session.sessionId, session.cwd).then(async (result) => {
const response = result || "(empty response)";
const chunks = splitMessage(response);
for (const chunk of chunks) {
+2 -2
View File
@@ -59,10 +59,10 @@ export class ClaudeService {
};
}
async sendMessage(prompt: string, sessionId: string): Promise<string> {
async sendMessage(prompt: string, sessionId: string, cwd: string): Promise<string> {
const raw = await runClaude(
["-p", prompt, "--output-format", "json", "--resume", sessionId, "--dangerously-skip-permissions", "--append-system-prompt", APPEND_PROMPT],
process.cwd(),
cwd,
);
const parsed = JSON.parse(raw.trim().split("\n").pop()!) as CliJsonResult;