Skip to content

fix(cli): unify teardown drain into a single bounded flush mode - #395

Draft
khaliqgant wants to merge 1 commit into
mainfrom
fix/305-unify-teardown-drain
Draft

fix(cli): unify teardown drain into a single bounded flush mode#395
khaliqgant wants to merge 1 commit into
mainfrom
fix/305-unify-teardown-drain

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Aug 4, 2026

Copy link
Copy Markdown
Member

Fixes #305.

--flush-outbox-once is now the sole bounded teardown mode in both relayfile-mount and the relayfile CLI, replacing the --flush-outbox-once/--push-local-once split. File watcher observations are durably journaled before debounce under .relay/outbox/local-pending so a flush ingests only journaled paths with scan-free state saves (O(pending), never O(tree)), then force-flushes persisted outbox records. Generation-checked clearing prevents an in-flight upload from erasing a newer event.

Test plan

  • go build ./...
  • go test ./cmd/relayfile-cli/... -count=1
  • go test ./cmd/relayfile-mount/... -count=1
  • go test ./internal/mountsync/... -count=1

Real watcher, mountsync, generation-race, and CLI end-to-end regression tests added.

Review in cubic

--flush-outbox-once is now the sole bounded teardown mode in both
relayfile-mount and the relayfile CLI, replacing the
--flush-outbox-once/--push-local-once split. File watcher observations
are durably journaled before debounce under .relay/outbox/local-pending
so a flush ingests only journaled paths with scan-free state saves
(O(pending), never O(tree)), then force-flushes persisted outbox
records. Generation-checked clearing prevents an in-flight upload from
erasing a newer event.

Fixes #305.

Verified independently:
- go build ./...
- go test ./cmd/relayfile-cli/... -count=1
- go test ./cmd/relayfile-mount/... -count=1
- go test ./internal/mountsync/... -count=1
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f54a00df-f1b7-40de-b79a-3da6b7b42f53

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Relayfile Eval Review

Run: .relayfile/evals/runs/2026-08-04T17-53-53-030Z-HEAD-provider
Mode: provider
Git SHA: c45e9bd

Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0

Human Review Cases

No reviewable human-review cases captured Relayfile output.

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.

Bounded teardown drain: always ingest pending writeback drafts (retire the --flush-outbox-once / --push-local-once split)

1 participant