diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-24 23:35:00 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-24 23:35:00 +0200 |
| commit | f50d8dcb7515e7f12cf80d04fed93f15b87c4102 (patch) | |
| tree | 0e297a85f518d0dc01c5d214c8f5146a45b83363 /pi/agent/extensions/ask-mode | |
| parent | 4de5835e2b437f0450b571006e96f5a663d59966 (diff) | |
hyperstack: gpt-oss-120b + qwen3-coder-next dual-VM pair on A100x1
- Add hyperstack-vm1-gptoss.toml: A100x1 config for gpt-oss-120b (VM1)
and qwen3-coder-next (VM2) pair, replacing the H100x2 default
- Fix pi/agent/models.json: hyperstack provider URL was pointing at
hyperstack.wg1 (unresolvable); corrected to hyperstack1.wg1 (192.168.3.1)
- Update hyperstack.rb, hypr.fish: reference vm1-gptoss.toml for create-both
and pair commands; update fish abbrs for the new pair setup
- Update ask-mode/utils.ts: allow read-only 'ask' commands in ask-mode
- Update agent-plan-mode/utils.ts: tighten isAskCommand check
- Add state files for provisioned vm1/vm2 instances
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'pi/agent/extensions/ask-mode')
| -rw-r--r-- | pi/agent/extensions/ask-mode/utils.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pi/agent/extensions/ask-mode/utils.ts b/pi/agent/extensions/ask-mode/utils.ts index db8c889..835549e 100644 --- a/pi/agent/extensions/ask-mode/utils.ts +++ b/pi/agent/extensions/ask-mode/utils.ts @@ -87,7 +87,32 @@ const SAFE_PATTERNS = [ /^\s*exa\b/, ]; +const MUTATING_ASK_PATTERNS = [ + /\badd\b/i, + /\bannotate\b/i, + /\bappend\b/i, + /\bdelete\b/i, + /\bdenotate\b/i, + /\bdone\b/i, + /\blog\b/i, + /\bmodify\b/i, + /\bprepend\b/i, + /\bstart\b/i, + /\bstop\b/i, + /\bundo\b/i, + /\bpriority\b/i, + /\btag\b/i, +]; + +function isReadOnlyAskCommand(command: string): boolean { + const trimmed = command.trim(); + if (!trimmed.startsWith("ask ") && trimmed !== "ask") return false; + if (/[;&]/.test(trimmed) || /(^|[^|])\|([^|]|$)/.test(trimmed)) return false; + return !MUTATING_ASK_PATTERNS.some((pattern) => pattern.test(trimmed)); +} + export function isSafeAskModeCommand(command: string): boolean { + if (isReadOnlyAskCommand(command)) return true; const isDestructive = DESTRUCTIVE_PATTERNS.some((pattern) => pattern.test(command)); const isSafe = SAFE_PATTERNS.some((pattern) => pattern.test(command)); return !isDestructive && isSafe; |
