<think> tags and "thought" leaks into transcript feed with qwen-3.7-plus
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- typescript
Rechercherichtung
Reproduziere das Problem mit qwen-3.7-plus und untersuche, wie der Transkript-Feed mit -Blöcken und ihren schließenden Tags umgeht. Überprüfe, dass der Gedankeninhalt hinter dem Aufklapp-Steuerelement verborgen ist und kein literales -Tag im Feed erscheint.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
I am building a spell checking mod with qwen-3.7-plus and several times (when context gets a big longer), the <think> end tag isn't parsed and thus "thought" leaks into the feed window of TUI:
✻ Thought for 4 seconds [ctrl+o to expand]
⠶ </think>
The user wants me to continue. I need to fix the __dirname / import.meta issue. Since this is a mod that runs in Command Code's jiti environment, __dirname
should be available. But the TypeScript checker is complaining because it doesn't know about the runtime environment.
Let me simplify the _dirname resolution to just use __dirname since jiti provides it. Or I can use a different approach - use cmd.cwd which is the workspace
root, and then resolve relative to that.
Actually, looking at the mod-builder docs, mods are loaded by jiti which compiles TypeScript at load time. The __dirname should be available in that context.
But the TypeScript checker doesn't know about it.
Let me just use a simpler approach - declare __dirname as a global or use a try/catch approach. Or better yet, since the mod file and the dictionary file are in
the same directory, I can use import.meta.url but that also has issues with TypeScript.
The simplest fix is to just declare __dirname at the top of the file or use a different approach. Let me check what the mod-builder examples do.
Actually, looking at the mod-builder skill instructions, it says mods are loaded by jiti which compiles TypeScript at load time. In a CommonJS context (which
jiti uses), __dirname is available. The issue is just that TypeScript doesn't know about it.
Let me just add a declaration at the top of the file or use a workaround. The simplest is to use process.cwd() or pass the path as a parameter.
Actually, the best approach is to just use __dirname but declare it properly. Let me fix this.
Now fix the __dirname issue — jiti provides __dirname at runtime, but TypeScript doesn't know about it:
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Edit File .commandcode/mods/spell-checker.ts
534 │ - const _dirname = typeof __dirname !== 'undefined'
535 │ - ? __dirname
536 │ - : dirname(fileURLToPath(import.meta.url));
534 │ + // jiti (the mod loader) provides __dirname at runtime
535 │ + declare const __dirname: string;
536 │
538 │ - const BUILTIN_DICTIONARY_PATH = join(_dirname, 'frequency_dictionary_en_82_765.txt');
537 │ + const BUILTIN_DICTIONARY_PATH = join(__dirname, 'frequency_dictionary_en_82_765.txt');
Expected Behavior
- model though is hidden behind expand ctrl+0
Actual Behavior
The </think> end tag is seen in the feed conversation transcript.
Steps to reproduce the issue
- Use qwen-3.7-plus
Command Code Version
1.4.6
Operating System
macOS
Terminal/IDE
ghostty
Shell
zsh
Additional context
No response
- Vorherrschende Sprache
- Keine Sprachdaten
- Sterne
- 4k
- Forks
- 350
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus CommandCodeAI/command-code
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
CommandCodeAI/command-code#855 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
CommandCodeAI/command-code#841 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
CommandCodeAI/command-code#655 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
CommandCodeAI/command-code#608 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 70/100
CommandCodeAI/command-code#893 ·
Alle Issues in CommandCodeAI/command-code
Ähnliche Issues
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
JuliusBrussee/caveman#1102 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
use-agent-os/agent-os#3263 ·
-
[Bug]: context-limit error parsing has no pattern for llama.cpp's "context size (N tokens)" phrasing Offenarea/compression area/local-models area/sessions comp/agent duplicate P2 sweeper:risk-session-state type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
NousResearch/hermes-agent#117793 · 1 Kommentar ·
-
possible bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Mintplex-Labs/anything-llm#6415 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100