CommandCodeAI / CommandCodeAI/command-code

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

オープン
#607 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
言語のデータがありません
スター
4k
フォーク
350
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

.commandcode/mods/erd.ts の 115 行目で報告されている不正な正規表現を使って失敗を再現し、その後、mod builder と cmd mods list が読み込みの失敗をどのように処理するかを追跡します。コンパイルまたは読み込みのエラーが明確に表示され、mod が使用可能として一覧表示されるのではなく、利用不可または無効のステータスが表示されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
build-system, cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。