Render Markdown, add ask_human context, simplify inbox responses, group inbox by task

This commit is contained in:
Ian Gulliver
2026-10-14 10:37:04 -07:00
parent e9fd7de556
commit ca2644374d
25 changed files with 950 additions and 283 deletions
+4 -12
View File
@@ -317,7 +317,7 @@ func (e *env) openQuestions(sessionID string) []api.InboxItem {
}
questions := []api.InboxItem{}
for _, item := range items {
if item.Kind == api.InboxItemKindQuestion {
if item.Kind == api.Question {
questions = append(questions, item)
}
}
@@ -379,7 +379,7 @@ func TestAskHumanRoundTrip(t *testing.T) {
t.Fatalf("awaiting human: %d %v", waiting, err)
}
e.respond(m, q, api.InboxResponseTypeOption, "blue", "", api.Answered)
e.respond(m, q, api.Option, "blue", "", api.Answered)
events := e.waitIdle()
delivered := false
@@ -423,7 +423,7 @@ func TestFollowUpQuestionThread(t *testing.T) {
}
first := questions[0]
e.respond(m, first, api.InboxResponseTypeQuestion, "", "Before I pick: which of the two did you recommend, and why?", api.Open)
e.respond(m, first, api.Other, "", "Before I pick: which of the two did you recommend, and why?", api.Answered)
e.waitIdle()
questions = e.openQuestions(sess.Id)
@@ -435,15 +435,7 @@ func TestFollowUpQuestionThread(t *testing.T) {
t.Fatalf("follow-up didn't continue the thread: first %s/%s, second %s/%s", first.Id, first.ThreadId, second.Id, second.ThreadId)
}
old, err := e.store.GetInboxItem(e.ctx, first.Id)
if err != nil {
t.Fatalf("get first question: %v", err)
}
if old.State != api.Superseded {
t.Fatalf("first question is %s, want superseded", old.State)
}
e.respond(m, second, api.InboxResponseTypeFreeForm, "", "Use green instead of either.", api.Answered)
e.respond(m, second, api.Other, "", "Use green instead of either.", api.Answered)
e.waitIdle()
out, err := os.ReadFile(filepath.Join(e.task.WorktreePath, "color.txt"))