Finalize inbox artifacts and error protocol

This commit is contained in:
2026-03-19 03:25:06 +08:00
parent c3314cd9cf
commit f315d2330d
22 changed files with 659 additions and 86 deletions
+3 -4
View File
@@ -49,6 +49,9 @@ func newWatchCmd(root *rootOptions) *cobra.Command {
if err != nil {
return err
}
if !result.Woke {
return protocol.NoMatchingWork("no matching work before watch timeout")
}
data := map[string]any{
"woke": result.Woke,
@@ -73,10 +76,6 @@ func newWatchCmd(root *rootOptions) *cobra.Command {
if root.json {
return protocol.WriteJSON(cmd.OutOrStdout(), resp)
}
if !result.Woke {
_, err = fmt.Fprintln(cmd.OutOrStdout(), "watch timed out")
return err
}
_, err = fmt.Fprintf(cmd.OutOrStdout(), "watch woke on thread %s at event %d\n", result.Thread.ThreadID, result.NextEventID)
return err