feat(KB-622): unify steeringComments and comments into single comments field

- Merge steeringComments and comments into unified comments field in Task type
- Update TaskStore to use single comments array instead of separate steeringComments
- Add database migration to convert existing steeringComments to comments
- Update executor to inject all comments into AI execution context
- Update dashboard SteeringTab to use unified comments API
- Update CLI task steer command to use comments field
- Update PR comment handler to add comments via unified API
This commit is contained in:
gsxdsm
2026-04-01 07:05:23 -07:00
parent 8f00302fb6
commit 02a30a9e96
22 changed files with 294 additions and 260 deletions

View File

@@ -237,21 +237,21 @@ export class TaskExecutor {
// Mark as seen BEFORE attempting injection to prevent retry loops on failure
seenSteeringIds.add(comment.id);
// Format and inject the steering comment
const steeringMessage = formatSteeringCommentForInjection(comment);
// Format and inject the comment
const commentMessage = formatCommentForInjection(comment);
try {
executorLog.log(`Injecting steering comment into ${task.id}: ${summary}`);
await session.steer(steeringMessage);
executorLog.log(`Successfully injected steering comment into ${task.id}`);
executorLog.log(`Injecting comment into ${task.id}: ${summary}`);
await session.steer(commentMessage);
executorLog.log(`Successfully injected comment into ${task.id}`);
// Log to the task that steering was received
// Log to the task that comment was received
await this.store.logEntry(
task.id,
`Steering comment received mid-execution: ${summary}`,
`Comment received mid-execution: ${summary}`,
`by ${comment.author}`
);
} catch (err) {
executorLog.error(`Failed to inject steering comment for ${task.id}:`, err);
executorLog.error(`Failed to inject comment for ${task.id}:`, err);
// Comment is already marked as seen - we won't retry to avoid spamming
// the agent with failed injections. The error is logged for debugging.
}
@@ -551,10 +551,10 @@ export class TaskExecutor {
sessionRef.current = session;
// Register session so the pause listener can terminate it
// Initialize with empty set of seen steering comments
// Initialize with empty set of seen comments
const seenSteeringIds = new Set<string>();
if (detail.steeringComments) {
for (const comment of detail.steeringComments) {
if (detail.comments) {
for (const comment of detail.comments) {
seenSteeringIds.add(comment.id);
}
}
@@ -1874,10 +1874,10 @@ When all steps are complete: call \`task_done()\``;
}
/**
* Format a steering comment for injection into a running agent session.
* Format a comment for injection into a running agent session.
* Used for real-time steering during task execution.
*/
function formatSteeringCommentForInjection(comment: import("@fusion/core").SteeringComment): string {
function formatCommentForInjection(comment: import("@fusion/core").TaskComment): string {
const timestamp = formatTimestamp(comment.createdAt);
return `📣 **New steering feedback** — ${timestamp} (${comment.author}):\n\n${comment.text}\n\nPlease adjust your approach based on this feedback.`;
return `📣 **New feedback** — ${timestamp} (${comment.author}):\n\n${comment.text}\n\nPlease adjust your approach based on this feedback.`;
}