Skip to content

Sync fork with upstream anomalyco/opencode:dev - #3

Merged
Jaiminp007 merged 588 commits into
devfrom
sync-upstream-dev
Apr 11, 2026
Merged

Jaiminp007 merged 588 commits into
devfrom
sync-upstream-dev

Conversation

@Jaiminp007

Copy link
Copy Markdown
Collaborator

Summary

Syncs the Finny fork with the latest anomalyco/opencode:dev. This PR brings in ~587 upstream commits and needs manual conflict resolution before it can merge.

Conflict resolution notes

Per .agents/SYNC_FORK.md:

  • Keep Convex for any DB-layer conflicts in files we modified
  • Accept upstream SQLite/Drizzle files as-is (do NOT delete them) — they prevent future sync conflicts and account/repo.ts still depends on them
  • Keep Finny branding (name, titles, placeholders) and the 3 agents: build/research/chat
  • Finny-only files (.agents/, packages/finny-*, finny-*.txt) won't conflict

Known conflict hotspots from the abandoned rebase attempt:

  • packages/opencode/src/agent/agent.ts — upstream moved to Effect Service pattern; preserve build/research/chat agents
  • packages/opencode/src/command/index.ts — same Effect restructure; preserve Finny INIT/REVIEW descriptions + algos/code/backtest commands
  • packages/opencode/src/config/config.ts — upstream moved state to Service layer
  • packages/opencode/src/session/system.ts — keep PROMPT_FINNY_ANTHROPIC as fallback
  • packages/opencode/src/cli/cmd/tui/app.tsx — keep Finny terminal titles
  • packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx — keep Finny PLACEHOLDERS
  • packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips-view.tsx — keep Finny trading tips
  • Convex migration commit (245afbf) touches ~25 more files in session/server/tool/share/worktree that overlap upstream refactors

Test plan

  • Resolve all conflicts locally on sync-upstream-dev
  • bun install succeeds
  • bun turbo typecheck passes
  • bun turbo test passes
  • TUI starts and Home screen renders with Finny branding
  • All 3 agents (build/research/chat) appear in agent picker
  • Convex-backed session list loads
  • Provider dialog opens and saves keys

Generated with Claude Code

kitlangton and others added 30 commits April 1, 2026 23:46
…nAI-compatible providers (anomalyco#14973)

Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: Aiden Cline <[email protected]>
Copilot AI review requested due to automatic review settings April 11, 2026 02:34
@vercel

vercel Bot commented Apr 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
finny Error Error Apr 11, 2026 3:15am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

# Conflicts:
#	packages/opencode/package.json
#	packages/opencode/script/build.ts
#	packages/opencode/src/agent/agent.ts
#	packages/opencode/src/cli/cmd/db.ts
#	packages/opencode/src/cli/cmd/tui/app.tsx
#	packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
#	packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips-view.tsx
#	packages/opencode/src/cli/cmd/tui/routes/home.tsx
#	packages/opencode/src/command/index.ts
#	packages/opencode/src/config/config.ts
#	packages/opencode/src/control-plane/workspace.ts
#	packages/opencode/src/index.ts
#	packages/opencode/src/project/project.ts
#	packages/opencode/src/server/server.ts
#	packages/opencode/src/session/index.ts
#	packages/opencode/src/session/message-v2.ts
#	packages/opencode/src/session/processor.ts
#	packages/opencode/src/session/revert.ts
#	packages/opencode/src/session/system.ts
#	packages/opencode/src/session/todo.ts
#	packages/opencode/src/share/share-next.ts
#	packages/opencode/src/tool/registry.ts
#	packages/opencode/src/tool/todo.ts
#	packages/opencode/src/worktree/index.ts
#	packages/opencode/test/control-plane/session-proxy-middleware.test.ts
#	packages/opencode/test/control-plane/workspace-sync.test.ts
#	packages/opencode/test/server/session-list.test.ts
#	packages/opencode/test/storage/json-migration.test.ts
#	packages/sdk/js/src/v2/gen/types.gen.ts
@Jaiminp007
Jaiminp007 merged this pull request into dev Apr 11, 2026
1 of 2 checks passed
Jaiminp007 pushed a commit that referenced this pull request May 2, 2026
Fixes all 17 Copilot comments:

Telemetry opt-out (#1, #2, #3, #9, #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 (#5, #14, #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 (#10, #11, #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 (#4, #6, #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 (#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 (#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 (#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]>
Jaiminp007 pushed a commit that referenced this pull request May 3, 2026
#1 Always return JSON from algorithm-list. The empty-state branch
   previously returned a plain English string while the populated
   branch returned JSON; now both branches return the same shape so
   any caller can parse the output uniformly.

#2 Normalize capacity / remaining to (number | null) everywhere.
   The structured body and the metadata field both use null for
   unlimited tiers — no more Number.POSITIVE_INFINITY in metadata
   silently coercing to null when serialized for logs/telemetry.

#3 Tests for buildAlgorithmListPayload — extracted as a pure helper
   so the dedupe-by-name, latest-version-wins, capacity reporting,
   and JSON-roundtrip behavior can be exercised without spinning up
   Convex or the Plan service.

#4 Tests for countUniqueAlgorithms — the cap-check helper extracted
   from algorithm-save. Covers the orphan-row scenario (duplicate
   names not consuming extra cap slots) and the at-cap boundary
   condition that blocks new saves.

This branch had an error being deployed

1 failed deployment
Preview — 0c4a57b4 Deployed Apr 11, 2026 by vercel[bot]
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.