Skip to content

feat: add opt-in, versioned watchlist context per run - #418

Open
2859493743 wants to merge 1 commit into
helsome:mainfrom
2859493743:feat/37-watchlist-context
Open

2859493743 wants to merge 1 commit into
helsome:mainfrom
2859493743:feat/37-watchlist-context

Conversation

@2859493743

Copy link
Copy Markdown

Summary

  • Add an explicit per-conversation opt-in for watchlist context.
  • Resolve selected symbols to canonical instrument identities and provider aliases, then freeze a versioned snapshot on each run.
  • Persist and inject the snapshot into the Pi prompt so historical runs remain reproducible and citations still come from real tool calls.

Scope: This PR implements the Watchlist portion only. Portfolio context, watchlist metadata (tags/groups/thesis), and the remaining Issue #37 acceptance criteria are not included. It does not close #37.

Validation

Environment: Windows 11 Home 10.0.26200 x64, Bun 1.4.1, Electron 39.8.9, LongBridge CLI 0.31.1.

  • bun test --isolate packages/shared/src/kernel/watchlist-context.test.ts packages/shared/src/agent/workspace-context.test.ts packages/shared/src/kernel/run-manager.test.ts packages/ui/src/atoms/watchlistContextAtoms.test.ts packages/ui/src/components/agent/WatchlistContextControl.test.tsx packages/ui/src/lib/persistedPrefs.test.ts apps/electron/src/main/kernelHost.test.ts packages/shared/src/agent/pi-runtime-adapter.test.ts packages/shared/src/agent/pi-runtime-agent-backend.test.ts packages/core/src/instrument.test.ts → 103 passed, 0 failed.
  • bun test --isolate packages/ui/src/atoms/quoteAtoms.test.ts → 8 passed, 0 failed.
  • bun run typecheck → passed.
  • bun run i18n:check → passed; en-US and zh-CN parity, 0 issues.
  • git diff --check → passed.
  • Live E2E with Magpie hub/gpt-6.1-terra: queried five real watchlist listings via LongBridge get_kline; 5/5 calls completed with persisted evidence and resolved citations, and the historical run snapshot remained unchanged after reload.

UI screenshot

Folio Copilot watchlist-context UI after the change

Known limitations

  • Portfolio context is outside this PR's scope.
  • The existing LongBridge CLI quote parser does not accept the current quote response shape; live quote display was not part of this watchlist-context E2E and is not changed here.

@2859493743
2859493743 marked this pull request as ready for review November 10, 2026 17:40
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.

[Portfolio Context] Add Watchlist and Portfolio context as explicit, versioned Copilot inputs

1 participant