Skip to content

Commit 9a6dab1

Browse files
committed
fix: hint message render order and harness/runtime disambiguation
- isHint check now comes after isExec (matching preview branch) so exec messages always render as magenta, not gray - When a project has both runtimes and harnesses and no flag is given, show a clear error listing both --runtime and --harness options
1 parent 05aa114 commit 9a6dab1

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

src/cli/commands/invoke/action.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,19 @@ export async function handleInvoke(context: InvokeContext, options: InvokeOption
8686
if (isHarnessInvoke) {
8787
return handleHarnessInvoke(project, targetState, targetConfig, selectedTargetName, options);
8888
}
89+
90+
if (harnessEntries.length > 0 && project.runtimes.length > 0 && !options.agentName) {
91+
const runtimeNames = project.runtimes.map(a => a.name);
92+
const harnessNames = harnessEntries.map(h => h.name);
93+
return {
94+
success: false,
95+
error: new ValidationError(
96+
`Project has both runtimes and harnesses. Specify one:\n` +
97+
` --runtime: ${runtimeNames.join(', ')}\n` +
98+
` --harness: ${harnessNames.join(', ')}`
99+
),
100+
};
101+
}
89102
}
90103

91104
if (project.runtimes.length === 0) {

src/cli/tui/screens/invoke/InvokeScreen.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ function formatConversation(
4848
// Skip empty assistant messages (placeholder before streaming starts)
4949
if (msg.role === 'assistant' && !msg.content) continue;
5050

51-
if (msg.isHint) {
52-
lines.push({ text: msg.content, color: 'gray' });
53-
} else if (msg.role === 'user' && msg.isExec) {
51+
if (msg.role === 'user' && msg.isExec) {
5452
lines.push({ text: msg.content, color: 'magenta' });
5553
} else if (msg.role === 'user') {
5654
lines.push({ text: `> ${msg.content}`, color: 'blue' });
5755
} else if (msg.isExec) {
5856
lines.push({ text: msg.content });
57+
} else if (msg.isHint) {
58+
lines.push({ text: msg.content, color: 'gray' });
5959
} else if (msg.parts && msg.parts.length > 0) {
6060
// Rich AGUI rendering: render each part with distinct visual treatment
6161
for (const part of msg.parts) {

0 commit comments

Comments
 (0)