Skip to content

Harden scheduled watcher delivery - #17

Merged
Nisarg38 merged 1 commit into
codex/native-scheduled-watchersfrom
codex/scheduled-watchers-reliability
May 8, 2026
Merged

Nisarg38 merged 1 commit into
codex/native-scheduled-watchersfrom
codex/scheduled-watchers-reliability

Conversation

@Nisarg38

@Nisarg38 Nisarg38 commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • start scheduled watcher processing from the normal TUI worker with scheduler ownership locking
  • persist watcher baselines and pending findings in local SQLite
  • add deterministic materiality checks, durable retry delivery, cadence warnings/caps, and expanded watcher status output

Validation

  • bun test ./test/cron/schedule.test.ts ./test/cron/watcher-state.test.ts --preload ./test/preload.ts
  • bun run typecheck
  • pre-push hook: bun turbo typecheck

@Nisarg38
Nisarg38 marked this pull request as ready for review May 8, 2026 05:50
@Nisarg38
Nisarg38 merged commit b67a00f into codex/native-scheduled-watchers May 8, 2026
spandanniroula pushed a commit to spandanniroula/finny that referenced this pull request Jun 12, 2026
Fixes all 17 Copilot comments:

Telemetry opt-out (polarline-markets#1, polarline-markets#2, polarline-markets#3, polarline-markets#9, polarline-markets#16):
- tracker.ts now reads FINNY_TELEMETRY=0 / OPENCODE_TELEMETRY=0 at module
  load, so the opt-out applies in every entrypoint (TUI worker, server,
  CLI), not just the bootstrap path.
- Email dialog auto-prompt and /subscribe slash command also gated on
  Analytics.isEnabled() — email POST goes to the same Convex deployment.

Tracker correctness (polarline-markets#5, polarline-markets#14, polarline-markets#17):
- drain() now also waits for the DeviceProfile.userId() resolution promise,
  not just the post-send promise.
- worker rpc.shutdown() and main-thread thread.ts both call
  Analytics.drain() before tearing down — neither beforeExit nor SIGTERM
  fire on worker.terminate() / process.exit(0).
- beforeExit handler runs at most once per process, preventing an infinite
  drain loop when a hung telemetry request later resolves and re-empties
  the loop.

Privacy (polarline-markets#10, polarline-markets#11, polarline-markets#12):
- Drop process.argv from tui.worker.booted (could include --prompt text
  and project paths).
- error.surfaced now sends only error.name; error messages frequently
  embed user prompt content and local file paths.
- Don't persist the submitted email address to local KV (no reader, just
  unnecessary PII retention).

Email dialog state machine (polarline-markets#4, polarline-markets#6, polarline-markets#8):
- Wait for kv.ready before evaluating the prompt gate so we don't re-show
  the dialog to users who already submitted/skipped.
- Conditional dismiss handler — only marks "skipped" when no terminal
  status has been set, so a successful submit isn't overwritten by the
  dismiss callback that fires on dialog.clear() and isn't suppressed by
  another dialog replacing this one.

Server-side validation (polarline-markets#15):
- subscribe mutation now rejects empty / oversized / regex-failing emails
  with a ConvexError, so the public Convex client can't bypass the TUI
  regex.

Command coverage (polarline-markets#13):
- Hook Analytics.track() in DialogCommand.trigger() instead of the bus
  event handler. trigger() is the central activation point for palette,
  slash, keybind, plugin, and bus paths — single hook, full coverage,
  no double-counting.

Comment wording (polarline-markets#7):
- bootstrap.ts: "opt-in by default" → "enabled by default" (correct
  description of opt-out semantics).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.

1 participant