feat(ipc): add list and info query commands with lastSyncAt#1015
Merged
feat(ipc): add list and info query commands with lastSyncAt#1015
Conversation
benbjohnson
requested changes
Jan 19, 2026
This was referenced Jan 19, 2026
corylanou
added a commit
that referenced
this pull request
Jan 19, 2026
Per review feedback on PR #1015, this removes the /status endpoint and socket mode from the status command to avoid the confusing behavior where only one command requires the -socket flag. Instead of /status, the /list endpoint now includes lastSyncAt for each database, providing the sync timing information without needing a separate endpoint. Changes: - Remove GET /status endpoint from server - Remove -socket flag and runWithSocket from status command - Add LastSyncAt field to DatabaseSummary in /list response - Update tests accordingly Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
corylanou
added a commit
that referenced
this pull request
Jan 19, 2026
Per review feedback on PR #1015, this removes the /status endpoint and socket mode from the status command to avoid the confusing behavior where only one command requires the -socket flag. Instead of /status, the /list endpoint now includes lastSyncAt for each database, providing the sync timing information without needing a separate endpoint. Changes: - Remove GET /status endpoint from server - Remove -socket flag and runWithSocket from status command - Add LastSyncAt field to DatabaseSummary in /list response - Update tests accordingly Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
92ec82a to
bc02dc7
Compare
Add IPC status and query commands for the Litestream control system, building on the Unix socket infrastructure from Phase 1. New commands: - `litestream status -socket <path> <db>` - Query database replication status - `litestream list -socket <path>` - List all managed databases - `litestream info -socket <path>` - Show daemon information Server changes: - Add GET /status, /list, /info endpoints to the HTTP server - Add Version and startedAt fields to Server struct - Add StatusResponse, ListResponse, InfoResponse types The status command now supports both modes: - Config-based: reads local files for static status (existing behavior) - Socket-based: queries running daemon for live status (new) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use Replica.Pos() for faster cached position lookup - Fall back to db.Pos() only when replica position unavailable - Surface position read errors in StatusResponse.Error field - Improve status accuracy: distinguish "replicating" vs "open" vs "stopped" - "replicating": DB open with active replica monitor - "open": DB open but monitor disabled (e.g., -once mode) - "stopped": DB closed - Add nil check for Replica.Client before accessing - Add comprehensive server endpoint tests - Add CLI command tests for status, list, and info Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Address Codex review findings: - Fix checksum issue: Replica.Pos() only tracks TXID, so we now use db.Pos() which reads the full position including checksum - Add happy-path integration tests for info, list, and status CLI commands with socket mode Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Per review feedback on PR #1015, this removes the /status endpoint and socket mode from the status command to avoid the confusing behavior where only one command requires the -socket flag. Instead of /status, the /list endpoint now includes lastSyncAt for each database, providing the sync timing information without needing a separate endpoint. Changes: - Remove GET /status endpoint from server - Remove -socket flag and runWithSocket from status command - Add LastSyncAt field to DatabaseSummary in /list response - Update tests accordingly Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
bc02dc7 to
8c4f948
Compare
Collaborator
Author
|
Addressing review feedback from @benbjohnson: Fixed in commit bc02dc7 (now rebased as 8c4f948):
The status command now only works in config-based mode, consistent with other commands. Sync timing information is available through the |
benbjohnson
requested changes
Feb 2, 2026
- list command now shows: /path/to/db [status] (last sync: time) - info command now shows human-readable format with uptime - Added -json flag to both commands for raw JSON output Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
Author
|
@codex review |
- Validate timeout > 0 in info and list commands to prevent unexpected http.Client behavior with zero/negative values - Move startedAt assignment after successful socket listen to ensure uptime reflects actual server availability time - Add documentation clarifying LastSyncAt represents replica sync time, not just local WAL processing - Add test for "replicating" status when MonitorEnabled is true - Add tests for invalid timeout validation (zero and negative) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
benbjohnson
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
litestream list -socketcommand lists all managed databases with sync statuslitestream info -socketcommand shows daemon information (version, PID, uptime)lastSyncAtfield to database list for monitoring sync timingRelated Issue: #1013
Changes
Server (
server.go)GET /list,GET /infoHTTP endpointsVersionandstartedAtfields to Server structListResponse,InfoResponsetypesLastSyncAtfield toDatabaseSummaryfor monitoring last successful sync timeCLI Commands
list: New command to list all managed databases via socket (includes lastSyncAt)info: New command to show daemon information via socketstatus: Unchanged - uses config-based mode only (no socket mode)Command Registration (
main.go)listandinfocommandsTests Added
server_test.go)list_test.go,info_test.go)lastSyncAtfield in list responseDesign Decision
Per review feedback, the
/statusendpoint and-socketflag for the status command were removed. ThelastSyncAtfield was added to the/listresponse instead, providing sync timing information without requiring a separate endpoint. This avoids the confusing UX where only one command would need the-socketflag.Test plan
go build -o bin/litestream ./cmd/litestreamgo test -v ./...🤖 Generated with Claude Code