]> git.giacomolli.uk - onechat/commitdiff
Correct the remaining review style findings
authorAnderson A. Giacomolli <redacted>
Wed, 11 Nov 2026 14:38:34 +0000 (11:38 -0300)
committerAnderson A. Giacomolli <redacted>
Wed, 11 Nov 2026 14:38:34 +0000 (11:38 -0300)
Multiline callbacks and literals keep their required separators even
when the next operation has its own error assertion. The hook test
comment uses the repository reflow tool without changing fixtures. View
layout comments explain the current prompt-cache contract instead of
retaining historical measurements.

Issue: 3cdc678

.githooks/commit-msg-test
daemon_message_test.go
view_layout.go
whatsapp.go
whatsapp_fake_helper_test.go

index d7499ae3650879bce72e7931b143bde65eb63552..bed3275658e3e94d025c5386fc936aaa1e98e87b 100755 (executable)
@@ -25,8 +25,8 @@ reject() {
   grep -q "$1" "$work/output"
 }
 
-# The next word has 13 characters. Its preceding line has 60, so the
-# combined line has 74 characters and cannot fit the 72-column limit.
+# The next word has 13 characters. Its preceding line has 60, so the combined
+# line has 74 characters and cannot fit the 72-column limit.
 accept <<'MESSAGE'
 Reflow comments and expand event literals
 
index 3cca09f69e1876d216512745058086e622b6a222..a7792e8c9dfc2937b4cf9feec56e536d15dc6aea 100644 (file)
@@ -664,6 +664,7 @@ func TestMissingWhatsAppRouteChildFallsBackToRoot(t *testing.T) {
                ID:   whatsappTestAna.String(),
                Name: "Ana",
        }
+
        require.NoError(t, test.messages.routes.Set("whatsapp:"+chat.ID, "Missing"))
        whatsappRouteTestAdd(t, inbox, chat, "Please check the plan.")
        require.NoError(t, inbox.deliver(t.Context(), test.loops[0], WhatsAppLink{}, true))
@@ -819,6 +820,7 @@ func TestQueuedWhatsAppBatchUsesRootIfItsChildIsRemoved(t *testing.T) {
                ID:   whatsappTestAna.String(),
                Name: "Ana",
        }
+
        require.NoError(t, first.messages.routes.Set("whatsapp:"+chat.ID, "Garden"))
        whatsappRouteTestAdd(t, inbox, chat, "Keep the gate plan.")
        require.NoError(t, inbox.deliver(t.Context(), first.loops[0], WhatsAppLink{}, true))
@@ -853,6 +855,7 @@ func TestRoutedWhatsAppBatchesCanCloseOutOfNumberOrder(t *testing.T) {
                Name:  "Garden plans",
                Group: true,
        }
+
        require.NoError(t, test.messages.routes.Set("whatsapp:"+first.ID, "Garden"))
        require.NoError(t, test.messages.routes.Set("whatsapp:"+second.ID, "Garden"))
 
@@ -901,6 +904,7 @@ func TestWhatsAppCatchupSeparatesChildAndRootBatches(t *testing.T) {
                ID:   whatsappTestAna.String(),
                Name: "Ana",
        }
+
        require.NoError(t, test.messages.routes.Set("whatsapp:"+garden.ID, "Garden"))
        require.NoError(t, test.messages.routes.Set("whatsapp:"+library.ID, "Library"))
        inbox.waitForCatchup()
@@ -937,6 +941,7 @@ func TestRoutedWhatsAppQueueFailureKeepsTheInboxBatch(t *testing.T) {
                ID:   whatsappTestAna.String(),
                Name: "Ana",
        }
+
        require.NoError(t, first.messages.routes.Set("whatsapp:"+chat.ID, "Garden"))
        require.NoError(t, os.Mkdir(first.messages.path, 0o700))
        whatsappRouteTestAdd(t, inbox, chat, "Keep the gate plan.")
index 560abb21042ad854cb2e61fcbff4d0703b8ce624..a88c8fdb1bdf0c2f7f3accce0de78948936e6fd0 100644 (file)
@@ -18,9 +18,9 @@ const viewLayoutFileName = "layout.json"
 // grow between batches. The view goes out as the same messages as in the
 // request before, while their lines give the same text, and the new lines
 // follow as one new message. So the end of the view of each earlier turn stays
-// a message end. On the ChatGPT backend, the first request of a turn with this
-// layout read the view of the turn before from the prompt cache in each of 10
-// turns, and with the view in one message it missed once in 5.
+// a message end. Stable message boundaries let the model reuse the unchanged
+// view prefix from its prompt cache instead of invalidating it when new lines
+// arrive.
 //
 // The first message starts with "<chat>\n". The closing tag goes into the state
 // message after the view, so that no view message changes when lines come. The
index 91ee675553951e8c80755b279d7f3a76100811c4..df43e8e3d9b6026377e0eba90f3874b91b9277b1 100644 (file)
@@ -309,6 +309,7 @@ func (w *WhatsApp) Run(ctx context.Context, l *TurnLoop, notify func(Event)) err
 
        cancel := func() {
        }
+
        defer func() {
                cancel()
                pairing.Wait()
index 1fca3b00c22875f909b15823cfa3a7388ecf4448..4f12a16f9699891029950e8403b56fc26557c890 100644 (file)
@@ -439,6 +439,7 @@ func whatsappTestSession(t *testing.T, dir string, linked bool) {
                        AccountSignatureKey: make([]byte, 32),
                        DeviceSignature:     make([]byte, 64),
                }
+
                require.NoError(t, device.Save(t.Context()))
        }