Skip to content

fix(sync): suppress OpenCode SHM-only daemon watch pushes - #1321

Open
rodboev wants to merge 1 commit into
kenn-io:mainfrom
rodboev:pr/1317-opencode-shm-watch-filter
Open

fix(sync): suppress OpenCode SHM-only daemon watch pushes#1321
rodboev wants to merge 1 commit into
kenn-io:mainfrom
rodboev:pr/1317-opencode-shm-watch-filter

Conversation

@rodboev

@rodboev rodboev commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Daemon-delegated watch pushes currently treat every filesystem batch as dirty, so OpenCode's WAL shared-memory index can retrigger a zero-session push after the daemon reads a quiet database. The repeated opencode.db-shm sequence came from @ngocphamm's report.

This adds a provider-owned changed-path relevance check at the push trigger boundary. OpenCode-family SHM-only events become no-ops while checkpointed database writes and WALs containing frames continue to trigger synchronization. The existing provider classification from #956 remains the source of the SHM and WAL rules, and authoritative recovery batches continue to push.

All four watch notification owners route through the same gate: daemon PostgreSQL, daemon DuckDB, local PostgreSQL, and local DuckDB. Filesystem event delivery, local archive synchronization, coverage-degradation notification, startup and interval pushes, storage, and mirror schemas remain unchanged.

Closes #1317

@roborev-ci

roborev-ci Bot commented Aug 1, 2026

Copy link
Copy Markdown

roborev: Combined Review (f7f421b)

The change is incomplete: daemon DuckDB watches still trigger pushes for irrelevant OpenCode-family sidecar events.

Medium

  • cmd/agentsview/archive_write_backend.go:567 — The daemon DuckDB watch path calls the unfiltered notifier, so OpenCode-family SHM-only batches continue scheduling repeated DuckDB pushes. Use notifyPushForWatchBatchWithConfig(callbackCtx, loop, b.appCfg, batch) here as in the PostgreSQL path, and add daemon DuckDB coverage.

Reviewers: 2 done | Synthesis: codex, 9s | Total: 3m34s

@rodboev
rodboev force-pushed the pr/1317-opencode-shm-watch-filter branch from f7f421b to 1d15d5a Compare August 1, 2026 00:47
@rodboev rodboev changed the title fix(sync): suppress OpenCode SHM-only daemon watch pushes - Aug 1, 2026
@roborev-ci

roborev-ci Bot commented Aug 1, 2026

Copy link
Copy Markdown

roborev: Combined Review (1d15d5a)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 4m45s

@rodboev rodboev changed the title - fix(sync): suppress OpenCode SHM-only daemon watch pushes Aug 1, 2026
@rodboev
rodboev force-pushed the pr/1317-opencode-shm-watch-filter branch from 1d15d5a to 695ecd0 Compare August 1, 2026 01:16
@roborev-ci

roborev-ci Bot commented Aug 1, 2026

Copy link
Copy Markdown

roborev: Combined Review (695ecd0)

Medium-severity issue found in OpenCode watch-path relevance handling.

Medium

  • cmd/agentsview/archive_write_backend.go:323filepath.Clean converts both an empty root and an explicitly configured current-directory root (".") to ".", causing opencode_dirs = ["."] to be excluded from relevance checks. The watcher may still monitor this root through its fallback path, leaving SHM-only events unsuppressed and allowing the push feedback loop to continue. Reject empty roots before cleaning, preserve explicit "." roots, and add coverage for current-directory configuration.

Reviewers: 2 done | Synthesis: codex, 7s | Total: 6m25s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

opencode.db-shm trigger infinite pushes with agentsview pg push --watch

1 participant