Releases: agenticmail/enterprise
v0.5.534
Fix: Order Status Sync + Market Lookup
Root Cause Found
All 19 orders in the database had status='placed' forever — the system never updated them to filled when the exchange executed them. The CLOB API only shows 2 actually live orders, meaning 17 were filled but the DB didn't know.
poly_get_open_orders — Auto-Sync
- Compares DB
placedorders against CLOB live orders - Orders in DB as
placedbut no longer on exchange → automatically updated tofilled - This makes them appear in Trade History (which excludes
placed) - Reports: "17 stale orders synced to filled"
- Only truly live CLOB orders shown as open
poly_get_market — Better Lookups
- Added
clob_token_idsparameter lookup (agents often pass token IDs) - Added CLOB API fallback to resolve condition_id from token
- Error message now shows the failed input for debugging
v0.5.533
Fix: Archive Only Closed Positions + Filters & Detail Modal
Archive Logic Fixed
The archive was incorrectly moving ALL filled trades out of Trade History, leaving it empty. Now it only archives:
- Failed, rejected, cancelled orders (never executed)
- Filled trades for closed positions (sold or market resolved) — checked via on-chain position data
Filled trades for positions you still hold stay in Trade History where they belong.
Archive Display
- Now uses
renderFilteredTablewith search, filters (Side, Outcome, Status), and sort by date - Clicking a row opens the detail modal — same as live trading tab
- Shows P&L and Cost columns
- Proper empty state: "Only trades for closed positions (sold or resolved markets) are archived"
Archive GET Endpoint
- Added pagination (
page,pageSizeparams) withtotalPagesin response - Added filters (
side,status,searchquery params)
v0.5.532
Fix: Watcher AI Now Pulls API Keys from Database Settings
The AI analysis was showing 0 calls because getAIConfig() couldn't find the API key. LLM API keys are stored in the database system settings (configured via dashboard), NOT in .env files.
API Key Resolution Order (fixed)
ai_api_keystored directly inpoly_watcher_config(if user set one explicitly)- System settings
apiKeysfrom database — the primary source where users configure API keys via the dashboard - Agent's own model config provider key from the database
- Environment variables (last resort fallback)
What was wrong
The watcher config had provider=anthropic model=claude-3-5-haiku-latest set but no ai_api_key. The previous fix (v0.5.530) only added env var fallback, but the actual keys live in the database settings. Now it correctly reads from db.getSettings().apiKeys.
v0.5.531
Fix: Trade History Archive + Empty Trades Tab
Archive endpoint missing
- Added GET
/polymarket/:agentId/archive/:tabendpoint — was completely missing, causing the "View Archive" button to spin forever - Supports tabs:
trades,exits,alerts,events - Returns archived rows from
*_archivetables with total count - Gracefully returns empty result with message if archive table doesn't exist yet
Archive loading fix
- Dashboard archive toggle now handles API errors instead of spinning forever
- Shows "No archived data yet" message when archive is empty
- Fixed
agentIdvariable reference (was using wrong scope variable)
Why Trade History might be empty
The Trades tab now correctly excludes status='placed' orders (v0.5.526). If all your orders are still pending/unfilled, the Trades tab will be empty — those orders appear in the Pending Orders tab instead. Only filled, failed, or cancelled orders show in Trade History.
v0.5.530
Fix: Watcher AI Analysis Now Uses Environment API Keys
The AI analysis in the Monitor tab was showing 0/10000 calls because getAIConfig() required an API key stored in poly_watcher_config, even when the agent already has API keys in its environment variables.
Fix
getAIConfig()now falls back to environment variables when noai_api_keyis stored in the watcher config- Supports:
ANTHROPIC_API_KEY,XAI_API_KEY,OPENAI_API_KEY,GROQ_API_KEY,DEEPSEEK_API_KEY,OPENROUTER_API_KEY,TOGETHER_API_KEY,FIREWORKS_API_KEY,CEREBRAS_API_KEY - Watchers configured with
provider=anthropic model=claude-3-5-haiku-latestwill now automatically use theANTHROPIC_API_KEYfrom the agent's environment - No code changes needed by users — just update and restart
v0.5.529
PIN-Gated Key Export, Agent Order Awareness, Dashboard Improvements
Export Private Key — PIN Required
- Export now requires wallet PIN verification before revealing key
- First-time users see "Set Up Wallet PIN" flow, then key exports automatically
- Modal auto-closes after 60 seconds for security
- Every export attempt requires fresh PIN entry (no cached unlock)
Agent Order Awareness
poly_get_open_orders: Returns placed-unfilled orders from trade log + live CLOB orders + total pending capitalpoly_cancel_order: Actually cancels on Polymarket CLOB exchange (was in-memory only)poly_cancel_all: Cancels both approval-pending and all live CLOB orders- System prompt: Agents MUST call
poly_get_open_ordersat session start (CALL #3) - Explicit warning: "placed" ≠ "filled"
Dashboard
- Pending orders modal: proper background/styling matching other modals
- Chart hide/show toggle persisted to localStorage
- Live Positions: page size 10, sorted by closing date
- Balance:
available_to_trade= exchange balance minus pending order capital
v0.5.528
Agents Now Track Unfilled Orders + CLOB Cancel + Dashboard Improvements
Agent Order Awareness
poly_get_open_ordersnow returns ALL unfilled orders: approval-pending, placed-but-unfilled from trade log, AND live orders from Polymarket CLOB exchange. Shows total pending capital locked.poly_cancel_orderactually cancels on the Polymarket CLOB exchange (was only cancelling in-memory approval orders). Updates trade log tocancelled.poly_cancel_allcancels both in-memory pending AND all live CLOB orders viacancelAll().- Session protocol updated: agents MUST call
poly_get_open_ordersat session start (CALL #3) to review unfilled orders before placing new ones. - Explicit system prompt warning: "placed" ≠ "filled" — agents must not treat placed orders as completed trades.
Dashboard
- Pending order icon on Live Positions: clickable clock icon shows count of pending orders per position. Opens modal with full details (side, outcome, price, shares, cost, date).
- Chart toggle: Hide/Show Chart button persisted to localStorage — survives page refresh.
- Live Positions: page size reduced to 10 (was 20). Sorted by closing date (soonest first).
- Filters on all three tabs: Live Positions, Pending Orders, and Trades.
Balance
available_to_trade= exchange balance minus pending order capital (no more double-counting)- New
pending_order_capitalfield in balance response
v0.5.526
Fix: Balance Calculation & Dashboard Tab Filtering
Balance (poly_get_balance)
available_to_tradenow correctly =exchange_balanceminus capital locked in pending orders (was double-counting wallet + exchange balance)- New
pending_order_capitalfield shows how much is locked in unfilled orders - Informational message when capital is locked in pending orders
Dashboard Tabs
- Pending Orders: Approve/Reject buttons only show for approval-mode orders. Placed orders show "Awaiting fill" — no false approve prompts
- Live Positions: Now shows pending buy/sell indicators per position (e.g., "pending 10.0 sell"). Sorted by closing date (soonest first). Added Side/Outcome filters
- Trades: Only shows filled/completed trades. Sorted by date. Proper status filters
- All three tabs now have consistent filter dropdowns
Previous (v0.5.525)
- Pending orders separated from filled trades across all tabs
v0.5.525
Fix: Separate Pending Orders from Filled Trades
Pending (placed but unfilled) orders were incorrectly showing in the Trades tab and Live Positions alongside filled orders, making it look like trades had executed when they hadn't.
Changes
- Pending Orders tab now shows both approval-pending AND placed-but-unfilled orders
- Trades tab only shows filled/completed/failed trades (excludes unfilled
placedorders) - Live Positions fallback only counts filled orders for position calculation
- Dashboard badges: placed orders show yellow "pending" badge (was green like filled)
- P&L column: placed orders show "Awaiting fill" instead of "Open"
Also includes (from v0.5.524)
- Agents can no longer create or import wallets — dashboard only
- Wallet import requires explicit overwrite confirmation
saveWalletCredentials()preserves private key when only updating API creds- Fix TypeScript error in connection-manager.ts
v0.5.524
Wallet Security — Prevent Private Key Loss
- Agents can no longer create or import wallets — removed
generateWallet(), allpoly_create_account/poly_setup_walletreferences from system prompts, tools, and docs - Wallet import requires confirmation — API returns
409 EXISTING_WALLETif wallet already exists; dashboard shows confirmation dialog warning about permanent key loss saveWalletCredentials()preserves existing private key — when only API creds are being updated, the private key is no longer overwritten- All "no wallet" errors now direct users to the dashboard instead of nonexistent agent tools
- Fix TypeScript error in
connection-manager.ts