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 bace63b524
commit afc24408cc
22 changed files with 294 additions and 260 deletions

View File

@@ -1615,9 +1615,9 @@ describe("buildExecutionPrompt", () => {
expect(result).not.toContain("## Project Commands");
});
it("includes Steering Comments section when steeringComments has entries", () => {
it("includes Comments section when comments has entries", () => {
const task = createMockTaskDetail({
steeringComments: [
comments: [
{
id: "1",
text: "Please handle the edge case",
@@ -1631,13 +1631,13 @@ describe("buildExecutionPrompt", () => {
expect(result).toContain("## Steering Comments");
expect(result).toContain("**user**");
expect(result).toContain("> Please handle the edge case");
expect(result).toContain("The following steering comments were added by the user");
expect(result).toContain("The following comments were added during execution");
});
it("formats multiple steering comments correctly", () => {
it("formats multiple comments correctly", () => {
const now = new Date();
const task = createMockTaskDetail({
steeringComments: [
comments: [
{
id: "1",
text: "First comment",
@@ -1660,29 +1660,29 @@ describe("buildExecutionPrompt", () => {
expect(result).toContain("> Second comment");
});
it("omits Steering Comments section when steeringComments is empty", () => {
const task = createMockTaskDetail({ steeringComments: [] });
it("omits Comments section when comments is empty", () => {
const task = createMockTaskDetail({ comments: [] });
const result = buildExecutionPrompt(task);
expect(result).not.toContain("## Steering Comments");
});
it("omits Steering Comments section when steeringComments is undefined", () => {
it("omits Comments section when comments is undefined", () => {
const task = createMockTaskDetail();
const result = buildExecutionPrompt(task);
expect(result).not.toContain("## Steering Comments");
});
it("includes only the 10 most recent steering comments", () => {
const steeringComments = Array.from({ length: 15 }, (_, i) => ({
it("includes only the 10 most recent comments", () => {
const comments = Array.from({ length: 15 }, (_, i) => ({
id: `${i}`,
text: `Comment ${i}`,
createdAt: new Date().toISOString(),
author: "user" as const,
}));
const task = createMockTaskDetail({ steeringComments });
const task = createMockTaskDetail({ comments });
const result = buildExecutionPrompt(task);
// Should include comments 5-14 (the 10 most recent), not 0-4
@@ -1725,7 +1725,7 @@ describe("buildExecutionPrompt", () => {
expect(result).toContain("## Steering Comments");
// Verify explanatory header text
expect(result).toContain("The following steering comments were added by the user during execution");
expect(result).toContain("The following comments were added during execution");
expect(result).toContain("Consider adjusting your approach or replanning remaining steps based on this feedback");
// Verify all three comments appear with correct author badges