CommandCodeAI / CommandCodeAI/command-code

Need to handle mods with code compilations errors on build and load

Aperta
#607 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Nessun dato sulla lingua
Stelle
4k
Fork
350
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Summary

I built a mod, but while the cmd mods list showed it as available in the project, the command it had did not appear.

Turns out there was a compilation issue, but I had no way of knowing:

 in the @.commandcode/mods/erd.ts there should be comands but i have reloaded but i dont see them available. but i see it is available cmd mods list

  Built-in mods (4)
    provider-anthropic · builtin
    provider-copilot · builtin
    provider-openai · builtin
    update-notice · builtin

  Mods (1)
    erd · project

✻ Thought for 1 second [ctrl+o to expand]

⠶ Let me look at your mod file and check the Command Code mod docs to figure out why the commands aren't appearing.

 READ  [.commandcode/mods/erd.ts] 1011 lines

✻ Thought for 6 seconds [ctrl+o to expand]

⠶ Let me check if there's a TypeScript compilation issue or missing dependency.

 SHELL  [ls ~/projects/dthyresson/erd-mod/node_modules/@commandcode/harness 2>&1 | head -5]
 │ ls: /Users/dthyresson/projects/dthyresson/erd-mod/node_modules/@commandcode/harness: No such file...
 └  ... [ctrl+o to expand]

 SHELL  [ls ~/projects/dthyresson/erd-mod/schema/ 2>&1]
 └ schema.sql

 SHELL  [node -e "try { require('~/projects/dthyresson/erd-mod/.commandcode/mods/erd.ts'); } catch(e) { co...]
 │ Invalid regular expression: /^\s*\S+\s+([A-Za-z_]+(?:\s*\([^)]*(?:\([^)]*\)[^)]*)*\))?(?:\s|$)/i:...
 └  ... [ctrl+o to expand]

✻ Thought for 29 seconds [ctrl+o to expand]

⠶ Found the issue. The regex on line 115 has an unmatched parenthesis — the capture group ( is never closed, making the regex invalid. This causes the mod to fail
  to load entirely, which is why /cmd mods list shows it but none of its commands appear.
Expected Behavior
  • the mod builder should run some type or compile checks
  • on load of the mod, warn that a mod failed to load so can correct (or status of disable due to error)
  • something to know while mod isn't working/available
Actual Behavior
  • mod listed but commands it implements not present
Steps to reproduce the issue
  • use mod builder but introduce some type or build compilation error in it
Command Code Version

1.5.0

Operating System

macOS

Terminal/IDE

ghostty

Shell

zsh

Additional context

No response

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci il fallimento usando l’espressione regolare malformata segnalata alla riga 115 di .commandcode/mods/erd.ts, quindi traccia il modo in cui il mod builder e cmd mods list gestiscono il caricamento fallito. Il lavoro è completato quando gli errori di compilazione o caricamento vengono mostrati chiaramente e lo stato non disponibile o disabilitato del mod è visibile invece di elencarlo come utilizzabile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
build-system, cli
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.