Bold questions

This commit is contained in:
Ian Gulliver
2026-10-14 19:35:34 -07:00
parent ab4c3d2c6f
commit 1ea055682b
54 changed files with 3696 additions and 762 deletions
+9 -8
View File
@@ -12,7 +12,6 @@ import (
"g.fc.run/misc/byre/internal/api"
"g.fc.run/misc/byre/internal/mcp"
"g.fc.run/misc/byre/internal/report"
"g.fc.run/misc/byre/internal/store"
)
@@ -38,7 +37,7 @@ func (m *Manager) askTool(l *live) mcp.Tool {
Description: "Ask the human a question through their inbox. Use this for every question; never ask in plain prose. " +
"The human answers from their inbox without having read your transcript, so every question must stand on its own: " +
"put the background they need in context. " +
"Offer concrete options and recommend one. If blocking is true, call report and end your turn after asking; " +
"Offer concrete options and recommend one. If blocking is true, end your turn after asking; " +
"the answer arrives as your next message. If blocking is false, continue with work that doesn't depend on the answer. " +
"Ask several questions in one turn by calling this once per question; they are answered together. " +
"To answer a follow-up question from the human, call this again with the thread_id they gave you.",
@@ -119,8 +118,12 @@ func (m *Manager) ask(ctx context.Context, l *live, raw json.RawMessage) (string
return "", err
}
m.mu.Lock()
l.asked = true
m.mu.Unlock()
if *args.Blocking {
return fmt.Sprintf("Question %s filed in the human's inbox. It is blocking: call report, then end your turn. The answer will arrive as your next message.", id), nil
return fmt.Sprintf("Question %s filed in the human's inbox. It is blocking: end your turn now. The answer will arrive as your next message.", id), nil
}
return fmt.Sprintf("Question %s filed in the human's inbox. Continue with work that doesn't depend on it; the answer will arrive as a later message.", id), nil
}
@@ -170,11 +173,11 @@ func (m *Manager) validateAsk(ctx context.Context, l *live, args askArgs) error
return nil
}
func (m *Manager) fileReport(l *live, r report.Report) string {
func (m *Manager) fileSummary(l *live, text string) string {
id := store.NewID()
err := m.store.CreateInboxItem(context.Background(), m.newItem(l, id, id, api.Report, api.Fyi, false, store.ToPayload(r)))
err := m.store.CreateInboxItem(context.Background(), m.newItem(l, id, id, api.Report, api.Fyi, false, map[string]any{"text": text}))
if err != nil {
slog.Error("file report", "session", l.id, "err", err)
slog.Error("file turn summary", "session", l.id, "err", err)
return ""
}
return id
@@ -273,8 +276,6 @@ func deliveryMessage(pending []store.Pending) string {
switch p.Item.Kind {
case api.Question:
fmt.Fprintf(b, "Your question %s: %s\n", p.Item.Id, p.Item.Payload["question"])
case api.Report:
fmt.Fprintf(b, "Your report %s\n", p.Item.Id)
case api.SessionError:
fmt.Fprintf(b, "Your error %s: %s\n", p.Item.Id, p.Item.Payload["error"])
case api.RateLimited: