fix: use --append-system-prompt for Russian, change greeting to Russian
This commit is contained in:
@@ -39,7 +39,7 @@ export function registerCommands(
|
|||||||
|
|
||||||
// Run Claude session creation without blocking the bot
|
// Run Claude session creation without blocking the bot
|
||||||
claude.createSession(
|
claude.createSession(
|
||||||
"You are now connected via Telegram. Briefly confirm you're ready and state the project directory.",
|
"Ты подключён через Telegram. Коротко подтверди готовность и укажи рабочую директорию проекта.",
|
||||||
resolved.path,
|
resolved.path,
|
||||||
).then(({ sessionId, result }) => {
|
).then(({ sessionId, result }) => {
|
||||||
manager.createSession(resolved.name, resolved.path, sessionId);
|
manager.createSession(resolved.name, resolved.path, sessionId);
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ function runClaude(args: string[], cwd: string): Promise<string> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const SYSTEM_PROMPT = "Always respond in Russian. Be concise.";
|
const APPEND_PROMPT = "Always respond in Russian. Be concise.";
|
||||||
|
|
||||||
export class ClaudeService {
|
export class ClaudeService {
|
||||||
async createSession(prompt: string, cwd: string): Promise<ClaudeResult> {
|
async createSession(prompt: string, cwd: string): Promise<ClaudeResult> {
|
||||||
const raw = await runClaude(
|
const raw = await runClaude(
|
||||||
["-p", prompt, "--output-format", "json", "--dangerously-skip-permissions", "--system-prompt", SYSTEM_PROMPT],
|
["-p", prompt, "--output-format", "json", "--dangerously-skip-permissions", "--append-system-prompt", APPEND_PROMPT],
|
||||||
cwd,
|
cwd,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ export class ClaudeService {
|
|||||||
|
|
||||||
async sendMessage(prompt: string, sessionId: string): Promise<string> {
|
async sendMessage(prompt: string, sessionId: string): Promise<string> {
|
||||||
const raw = await runClaude(
|
const raw = await runClaude(
|
||||||
["-p", prompt, "--output-format", "json", "--resume", sessionId, "--dangerously-skip-permissions"],
|
["-p", prompt, "--output-format", "json", "--resume", sessionId, "--dangerously-skip-permissions", "--append-system-prompt", APPEND_PROMPT],
|
||||||
process.cwd(),
|
process.cwd(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user