Skip to content

Commit 97fd08b

Browse files
committed
fix(cli): cap skill description in /help to one line
Long descriptions used to spill over multiple wrapped lines in /help output. Truncate to 120 chars matching the prompt-listing budget, so one noisy SKILL.md cannot bury the rest of the help screen. Signed-off-by: Huang Rui <vowstar@gmail.com>
1 parent ec3c089 commit 97fd08b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/cli/qsoccliparseagent.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3275,13 +3275,18 @@ bool QSocCliWorker::runAgentLoop(
32753275
}
32763276
if (!userSkills.isEmpty()) {
32773277
compositor.printContent("Installed skills:\n");
3278+
constexpr int kHelpDescCap = 120;
32783279
for (const auto &skill : userSkills) {
32793280
QString line = QStringLiteral(" /") + skill.name;
32803281
if (!skill.argumentHint.isEmpty()) {
32813282
line += QLatin1Char(' ') + skill.argumentHint;
32823283
}
3284+
QString desc = skill.description;
3285+
if (desc.size() > kHelpDescCap) {
3286+
desc = desc.left(kHelpDescCap - 3) + QStringLiteral("...");
3287+
}
32833288
line += QStringLiteral(" [") + skill.scope + QStringLiteral("] - ")
3284-
+ skill.description + QLatin1Char('\n');
3289+
+ desc + QLatin1Char('\n');
32853290
compositor.printContent(line);
32863291
}
32873292
compositor.printContent("\n");

0 commit comments

Comments
 (0)