Skip to content

Conversation

@AdriankennethCS
Copy link

@AdriankennethCS AdriankennethCS commented Dec 26, 2025

Body:

Fix Agents Details: ensure selection updates and details panel renders reliably

Fix Replay date inputs: switch to text inputs with multi-format parsing + validation + persistence

Add data-testid hooks needed for Comet QA selectors

Fix UI components (Button/Card) to forward DOM attributes (e.g., data-testid) via props spread

QA checklist

Agents: clicking Details updates right panel and header

Replay: typing/pasting dates works; values persist after Load; invalid formats show error

Comet selectors: [data-testid="agent-detail-panel"], replay-from/to/load, etc. present

Type-check + build passpread

data-testid hooks verified in DevTools: agent-detail-panel, agent-detail-title, replay-from/to/load


Note

Establishes a TypeScript monorepo alongside Python with a full Node API and React web dashboard.

  • API (apps/api): Express server with routes (/health, /agents, /replay, /chat), Zod validation, centralized error handling, in-memory stores (state/equity/log/chat), agent strategies (FlatValue, FractionalKelly, RandomBaseline) via AgentRegistry, trading engine (applyOrderIntents) with PnL/exposure logic, agent runner + scheduler, market data layer (Gamma/CLOB) mapped to MarketSnapshot, and comprehensive tests (Vitest)
  • Services/UX: ChatService (OpenAI or mock) with robust JSON error responses and PowerShell scripts for smoke/chat; replay service and sanity runner
  • Web (apps/web): React app scaffold with API client, views (Dashboard/Agents/Replay/Chat), shell/layout, and verification/debug docs; Vite + Tailwind setup
  • Tooling: Add ESLint/Prettier configs, .gitignore, tsconfig, and workspace package wiring

Written by Cursor Bugbot for commit 9e6ba5d. This will update automatically on new commits. Configure here.


Summary
This PR addresses QA automation blockers and review feedback across Atlas Prediction Lab:

Ensures data-testid attributes propagate correctly through shared UI components (Button/Card).

Removes duplicate “initial fetch” calls on mount where usePolling(..., enabled=true) already performs the initial request.

Prevents duplicated user messages in the LLM prompt by building the message array before persisting the current user message into the chat store.

Removes leftover debug logging from App.tsx.

Changes

apps/web/src/ui/Button.tsx, apps/web/src/ui/Card.tsx

Forward DOM attributes reliably (e.g., data-testid, aria-*) by spreading props correctly.

apps/web/src/components/AgentsView.tsx

Remove redundant mount useEffect fetch (usePolling already does initial fetch).

apps/web/src/components/Dashboard.tsx, apps/web/src/components/AgentDetail.tsx

Remove redundant mount fetch for same reason.

apps/web/src/App.tsx

Remove debug console.log.

apps/api/src/services/ChatService.ts

Fix duplicated user message in LLM prompt (avoid adding the user message to history before building the prompt messages).

How to test (manual)

Start dev:

pnpm -C apps/api dev

pnpm -C apps/web dev

Agents page:

Verify details panel updates when switching agents.

Verify data-testid selectors exist in DOM (DevTools console):

document.querySelector('[data-testid="agent-detail-panel"]')

document.querySelectorAll('[data-testid^="agent-details-btn-"]').length

Replay page:

Verify date inputs accept typing/paste and persist after “Load Replay”.

Verify selectors:

document.querySelector('[data-testid="replay-from"]')

document.querySelector('[data-testid="replay-to"]')

Chat:

Send a message and confirm it does not appear twice in the prompt/context behavior.

Notes

usePolling already handles initial fetch; removing the extra mount fetch reduces duplicate network calls.

Fix ChatView history pairing bug (sentMessageRef + effect only on chatResponse)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to Polymarket Agents. Thank you for creating your first PR. Cheers!

/>
)}
{view === 'replay' && <ReplayView />}
{view === 'chat' && <ChatView />}
Copy link

Choose a reason for hiding this comment

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

ChatView ignores selected agent from navigation

When handleOpenChat(agentId) is called from AgentsView, it sets selectedAgentId in App state and navigates to the chat view. However, ChatView is rendered without any props (<ChatView />), so it doesn't receive the selected agent. ChatView maintains its own internal selectedAgentId state initialized to empty string, and its useEffect auto-selects the first agent from the list. This means clicking "Chat" for a specific agent shows the wrong agent selected in the chat interface.

Additional Locations (1)

Fix in Cursor Fix in Web

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