Skip to content

fix: warn on hub sync and replication failures#101

Open
nanookclaw wants to merge 1 commit into
ActiveMemory:mainfrom
nanookclaw:fix/hubsync-replication-warnings
Open

fix: warn on hub sync and replication failures#101
nanookclaw wants to merge 1 commit into
ActiveMemory:mainfrom
nanookclaw:fix/hubsync-replication-warnings

Conversation

@nanookclaw
Copy link
Copy Markdown

Fixes #100.

Summary

This keeps hubsync and replication best-effort, but stops real failure paths from being indistinguishable from “nothing new.” hubsync.Sync now warns through internal/log/warn.Warn when config load, hub dial, sync RPC, or write-to-disk fails, while still returning an empty string so session start is never blocked. Successful zero-entry syncs remain quiet.

The replication loop now warns on dial, stream open, send, close-send, receive, and append failures. EOF remains a normal quiet termination. Append failures are reported without aborting the receive loop, so one failed local write does not prevent later entries from being consumed.

Focused regression coverage captures hubsync load/dial warnings and the replication dial-warning path. The warning strings are centralized in internal/config/warn because internal/audit rejects production magic strings.

Validation

  • ctx system bootstrap
  • GOTOOLCHAIN=go1.26.3 go test ./internal/cli/system/core/hubsync -count=1
  • GOTOOLCHAIN=go1.26.3 go test ./internal/hub -count=1
  • GOTOOLCHAIN=go1.26.3 go test ./internal/audit -count=1
  • PATH="/tmp/ctx-agent-bin:$PATH" GOTOOLCHAIN=go1.26.3 go test ./...
  • git diff --cached --check

Signed-off-by: Nanook <nanookclaw@users.noreply.github.com>
@nanookclaw nanookclaw requested a review from josealekhine as a code owner May 24, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hub: silent error suppression in hubsync hook + replication loop

1 participant