mirror of
https://github.com/JuliusBrussee/caveman.git
synced 2026-08-11 13:21:09 +02:00
fix: guard natural language activation against off default mode
Mirror the /caveman command path: skip writing flag file when getDefaultMode() returns 'off'. Without this, "talk like caveman" with CAVEMAN_DEFAULT_MODE=off would write 'off' to the flag file, making statusline/reinforcement inconsistent. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
56f4047ab3
commit
f7ef823b91
@@ -22,8 +22,11 @@ process.stdin.on('end', () => {
|
||||
if (/\b(activate|enable|turn on|start|talk like)\b.*\bcaveman\b/i.test(prompt) ||
|
||||
/\bcaveman\b.*\b(mode|activate|enable|turn on|start)\b/i.test(prompt)) {
|
||||
if (!/\b(stop|disable|turn off|deactivate)\b/i.test(prompt)) {
|
||||
fs.mkdirSync(path.dirname(flagPath), { recursive: true });
|
||||
fs.writeFileSync(flagPath, getDefaultMode());
|
||||
const mode = getDefaultMode();
|
||||
if (mode !== 'off') {
|
||||
fs.mkdirSync(path.dirname(flagPath), { recursive: true });
|
||||
fs.writeFileSync(flagPath, mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user