Spaces:
Sleeping
Sleeping
Commit History
-
Stream stall watchdog: cut half-open model connections, keep partial output
96kevinli29 +1: Claude Opus 4.8Even with heartbeats and a 1h timeout, a half-open upstream connection blocks the read forever without raising — the one remaining way to hang. The stream is now consumed via a pump thread with a stall watchdog (MATHAGENT_STREAM_STALL, default 180s): if no chunk arrives in time, the call is cut, partial output is kept with an explicit note, and the agent loop continues. Unit-tested with a fake stream that hangs after two chunks (cut at 2s, partial preserved). ui -> studio-v23-watchdog Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>992c412 -
Fix long-run stalls: 1h LLM timeout, keep partial on stream death, heartbeats, Stop button
96kevinli29 +1: Claude Opus 4.8An 851s/25k-token reasoning run froze. Three causes addressed: - litellm's default 600s timeout aborted long thinks -> pass timeout=3600 - a mid-stream failure used to fall back to a SILENT non-stream retry (frozen UI, double billing) -> if content already arrived, return the partial output with a truncation note instead - proxies (Render/CF ~100s idle) kill silent connections while models think -> server emits {"ev":"ping"} every 15s of queue silence; UI ignores pings but resets its liveness timer - UI: Stop button (AbortController; partial output kept), and a "no output for Ns" notice after 45s of silence. ui -> studio-v22-stall Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>6d554f6 -
Web v21: set the whole page in Computer Modern (KaTeX_Main); drop topbar status text
96kevinli29 +1: Claude Opus 4.8- body/headings now use the vendored KaTeX_Main face (the LaTeX font, already shipped for math) with Latin Modern/Georgia fallbacks — the page reads like a typeset paper, not a system-font website; base size up to 17.5px for CM's smaller x-height - removed the model/python status line from the masthead (it lives in the result metrics); badge -> v21 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>ac2c56e -
Web v20: editorial/journal restyle — get rid of the generic AI look
96kevinli29 +1: Claude Opus 4.8The cream+clay rounded-card aesthetic read as "obviously AI". New language is mathematical-press typesetting: - paper white, ink hairlines, square corners, zero drop shadows - body in Charter/serif; ALL metadata (labels, buttons, metrics, timeline heads) in small uppercase mono, like journal front-matter - answer as a theorem box (1.5px ink rule, italic "Answer." lead-in) - metrics collapsed to one mono footnote line with middot separators - masthead with a 2px ink rule; examples as a hairline-grid of exercises - ink/paper segmented control, oxblood accent (#8d2c15) reserved for links, active tab, CTA; every emoji removed from UI chrome - behavior identical (same JS flows); ui -> studio-v20-editorial Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>e772fdf -
Web v19: redesign — spacious single-column studio with a hero landing
96kevinli29 +1: Claude Opus 4.8Deliberate design pass ("make it feel substantial"): - single centered column (860px) replaces the cramped 300px sidebar layout - hero landing: large serif headline (Solve. Verify. Explore.) over a generous composer card — big borderless textarea, segmented Solve/Explore control, compact selects, prominent clay CTA that renames with the mode - examples as a 3-column card grid under the composer (Explore example switches the mode); attach/cost-cap on a quieter second row - history moved to a topbar button + fixed dropdown panel - results: serif answer line, hairline-divided metric row (no boxes), roomier tabs/timeline; follow-up bar integrated at the panel foot - same JS flows as v18 (streaming, guards, memory/context events) — behavior unchanged; ui -> studio-v19-design Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>fae2da8 -
Activate the workspace machinery: visible skills, working memory loop
96kevinli29 +1: Claude Opus 4.8The A-Evolve workspace was half-dormant in daily use: skills were injected invisibly, memory was read but never written, so the learning loop was broken. - solve() now emits a "context" step (skills loaded, lessons in memory, mode) — visible in the live stream and the Process timeline (📚/🧠 markers) - after every solve the agent records an episodic lesson (problem => outcome, turns, tool runs) via remember()+export_to_fs(); the next solve loads it — verified across fresh agent instances (0 lessons -> 1 lesson) - timeline renders context/memory/nudge steps; agent lifecycle now reads context -> reason -> act -> observe -> conclude -> remember - ui -> studio-v18-workspace Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>79d0fc6 -
Make solve mode visibly agentic: Python tool on by default + act-before-conclude
96kevinli29 +1: Claude Opus 4.8"It feels like just a chat model" — because default tools were off, the loop degenerated to one LLM call. Fixes: - Python (sympy) tool ON by default everywhere (zero-setup: sympy is a bundled dep). Lean stays opt-in. CLI gains --no-python for plain solves. - generalize the premature-final guard to all modes: a message with tool calls AND <final> gets the tools executed for real first, conclusion re-written from actual outputs — the plan → act → observe → conclude rhythm - solve-mode prompt: verify nontrivial computations before concluding; never put <final> in the same message as a tool call - verified live: cubic equation now runs 6 steps (plan, guard, factor with sympy, substitution check, conclude), answer verified, $0.04 - ui -> studio-v17-agentic Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>888348e -
Fix: Solve button did nothing — click event object was passed as followupText
96kevinli29 +1: Claude Opus 4.8addEventListener('click', solve) fed the PointerEvent into solve(followupText,…), so .trim() threw before the try block and the click died silently (introduced in v14 with the follow-up parameters; Cmd+Enter path was unaffected). Wrap the binding (()=>solve()) and type-guard the parameter. ui -> studio-v16. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>aa22a2e -
v15: task-adaptive modes (solve/explore), PDF paper ingestion, fabrication guards
96kevinli29 +1: Claude Opus 4.8Two research capabilities, adapted per task: - explore mode: long-horizon research. Protocol = conjecture -> real Python experiment -> refine, max_steps 24 (Python auto-enabled, budget suggested). Finalizes into a research report (Summary / Established results / Conjectures / Experiments / Open questions). - fabrication guards (the important part): models one-shot the whole cycle with *imagined* outputs — Sonnet emitted 22 tool blocks + <final> in one message. The loop now (a) ignores a premature final and actually executes the proposed experiments, (b) refuses tool-less conclusions (up to 2 nudges). Guards are unit-tested and shown in the UI timeline. Verified live: 32 real experiments, 1 guard fire, correct report, $0.49. - PDF ingestion: POST /api/upload (pypdf extraction, scanned-PDF warning), attachments injected into the task; UI "Attach PDF" chips; CLI --attach. CLI --mode explore. Deps: pypdf, python-multipart. ui -> studio-v15-explore. Co-Authored-By: Clau…2acdb4a -
Toward a research agent: arXiv search tool, context-aware follow-ups, persistent history
96kevinli29 +1: Claude Opus 4.8Closing the biggest gaps between "problem solver" and "math research agent": - arXiv literature tool (<tool:arxiv>query</tool>): read-only, key-free, ON by default — the agent decides when to look up related work and cites it - multi-turn follow-ups: solve(prior=...) continues a conversation; /api/solve* accept "history"; the UI adds a "Follow up" bar under every result (verified: "change the constant from 6 to 7" correctly reinterprets the previous equation -> complex roots) - history persists server-side (out/history.jsonl + /api/history); the sidebar restores past work after reloads/restarts - ui -> studio-v14-research Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>40c52ea -
Reliability audit fixes: Chinese PDF, no more silent export failures, full trace
96kevinli29 +1: Claude Opus 4.8Root causes found and fixed for "PDF doesn't come out / process is a black box": - CJK text made pdflatex fail silently -> now auto-switch to xelatex+ctex (MATHAGENT_TEX_LIBS env for HPC module lib paths, documented in .env.example) - models sometimes emit a full \documentclass wrapper -> sanitizer extracts the body so it compiles - compile errors were swallowed -> export() returns error/warning; API returns export_note; UI shows an amber banner; PDF failure auto-falls back to .docx - every solve now writes a downloadable trace-*.json (problem, model, usage, all steps) next to the outputs — nothing hidden - /api/health reports pdf_available; UI hides the PDF option on hosts without TeX (e.g. the HF Space container) and defaults to docx Audited end-to-end with the real model: 5/5 answers, 5/5 PDFs (incl. two Chinese problems), ~$0.01-0.03 per solve. ui -> studio-v13-audit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>f5b08d2 -
Make the repo HuggingFace Spaces-ready (Docker SDK metadata header)
96kevinli29 +1: Claude Opus 4.8Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>66c8e1f -
Add Dockerfile + .dockerignore for one-step deploy (Render/Railway/Fly/HF Spaces)
96kevinli29 +1: Claude Opus 4.8Binds 0.0.0.0:$PORT; set OPENROUTER_API_KEY (+ optional MATHAGENT_MAX_COST) as secrets. TeX for PDF is commented out to keep the image slim. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>69c2daa
-
Surface the cost cap: .env.example + README + web "cost cap $/solve" field
96kevinli29 +1: Claude Opus 4.8- .env.example documents MATHAGENT_MAX_COST - web UI adds a per-solve budget input (sends max_cost_usd) - README gains a Cost control section - ui -> studio-v12 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>f21ad2d -
Add cost/length controls: per-solve $ budget, per-call token cap (all optional)
96kevinli29 +1: Claude Opus 4.8- MathAgent: max_cost_usd and max_total_tokens per-solve budgets; the agent loop stops before making another LLM call once a cap is hit (defaults: no cap, so hard problems stay uncapped) - CLI: --max-cost and --max-tokens (plus existing --max-steps loop bound) - Web: SolveRequest.max_cost_usd + server default via MATHAGENT_MAX_COST env - note: per-call output stays uncapped unless --max-tokens is set; cumulative spend is bounded by max-steps (default 8) and any budget you set Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>d570109 -
Easier install (install.sh + clear README) and more robust streaming UI
96kevinli29 +1: Claude Opus 4.8- install.sh: one command sets up uv + venv + installs + seeds .env ("download & run") - README rewritten: 30-second quickstart, web/CLI usage, deploy, how-it-works - UI: live area shows a "connecting…" placeholder, and if a model doesn't stream token-by-token it now falls back to showing the step's reasoning — so the thinking view is never blank; verified streaming end-to-end (tokens, cost, PDF) - ui -> studio-v11 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>d253d86 -
Default to the plain model solve — Python/Lean verification now opt-in
96kevinli29 +1: Claude Opus 4.8Out-of-the-box it's just the model (clear, fewer moving parts, download-and-run). - ToolRegistry/default_registry default to python=off, lean=off - CLI: replace --no-python with opt-in --python (and --lean); web create_app enable_python defaults False; UI checkboxes unchecked - verification stays available, just off until you ask for it - ui -> studio-v10-plain, badge studio · v10 - verified: plain solve yields answer + PDF with 0 tool calls Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>06f86ec
-
Web v9: Claude-style UI + token-by-token streaming with live cost
96kevinli29 +1: Claude Opus 4.8- token streaming: provider streams the LLM (stream=True), emitting each token; agent forwards them as "token" events; UI renders the answer as it's written - live cost: OpenRouter price table (cached) × token counts, so the running meter shows tokens + $cost + elapsed during the run (streaming kept response cost too) - redesign to a warm, Claude-like aesthetic: cream canvas, clay accent, serif for the solution/answer, generous spacing, centered content panel - ui -> studio-v9-claude, badge studio · v9 - verified: streams tokens, reports cost $0.012, emits a working PDF Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>4dce2f7 -
Stabilize output: uncapped tokens + robust solution extraction (fixes missing answers/PDF)
96kevinli29 +1: Claude Opus 4.8Hard problems were truncated at 4096 tokens and reasoning models often omit the </final> tag or put text in a reasoning field — yielding empty answers, early stops, and broken PDFs. Now: - provider sends no max_tokens by default (uncapped: model's full output); falls back to message.reasoning_content when content is empty - MathAgent uncapped by default; _extract_solution handles a closed OR unclosed <final>, strips <think>…</think> and ``` code fences, so the LaTeX compiles - stronger finishing instruction (require </final>, LaTeX only, no length limit) - verified: Sonnet hard proof -> clean 2k-char solution, boxed answer, 102KB PDF; extraction unit-tested across closed/truncated/think/fenced cases - ui -> studio-v8-uncapped Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>a5b7648 -
Stop tracking unrelated embedded repo ai4math_demo (gitignore it)
96kevinli29 +1: Claude Opus 4.8Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>f6c125d -
Web: live streaming — show running cost and what the agent is doing in real time
96kevinli29 +1: Claude Opus 4.8Adds a streaming solve path so the UI is transparent *during* the run, not just after: - MathAgent.solve(on_event=...) emits an event per step (llm turn, tool_start, tool) carrying the running token/cost usage - /api/solve_stream streams NDJSON events while the solve runs (thread + queue), ending with a final "done" payload - UI consumes the stream: a live meter (tokens · $cost · elapsed · calls) and a live timeline that fills in as the model reasons and tools run; "working…" shows the current action - ui -> studio-v7-stream, badge studio · v7 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>c7cd508 -
Web: render math reliably — vendored KaTeX (offline) + LaTeX→HTML for solutions
96kevinli29 +1: Claude Opus 4.8Fixes "answer empty/garbled": the solution is a LaTeX document body, and MathJax was loaded from a CDN that may be blocked over the tunnel. Now: - bundle KaTeX locally under /static/katex (no external CDN), served via a mounted /static; FastAPI mounts it - latexToHtml() converts the model's LaTeX body (\textbf, enumerate/itemize, \[..\], $..$, \boxed) into readable HTML, then KaTeX typesets the math - the answer banner and inline math now render with KaTeX - ui -> studio-v6-katex, badge studio · v6 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>91a3b45 -
Web: bake model options into the HTML so the dropdown is never empty/unselectable
96kevinli29 +1: Claude Opus 4.8The <select> previously held only the placeholder until /api/models resolved; if that fetch failed (or a stale page loaded) there was nothing to pick. Ship the 4 options inline; JS still upgrades them to the live list on load. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>dcba0ce -
Web: trim model dropdown to four popular families (Opus, Sonnet, GPT, DeepSeek)
96kevinli29 +1: Claude Opus 4.8Still live-fetched (newest version per family); dropped Qwen/Gemini/Grok per preference for a short, focused list. Custom… remains for anything else. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>13f7085 -
Web: live model list — newest flagship per family from OpenRouter (no more stale picks)
96kevinli29 +1: Claude Opus 4.8- /api/models now fetches OpenRouter live and returns the newest model per family (Claude Opus/Sonnet, GPT-5.x, DeepSeek, Qwen, Gemini Pro, Grok), 10-min cached, with a refreshed static fallback. Returns "live": true when fetched. - picks today: Opus 4.8, Sonnet 4.6, GPT-5.5, DeepSeek V4 Pro, Qwen3.7 Max, Gemini 3.1 Pro, Grok 4.3 - ui badge -> studio · v5 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>10de9cf -
Web: light Google-style theme + clearer model dropdown
96kevinli29 +1: Claude Opus 4.8- redesign to a clean light "tech" palette: white surfaces, Google blue #1a73e8 accent, #dadce0 hairlines, soft shadows, Roboto, pill primary button - model is a labelled dropdown ("model — pick one") populated from /api/models, with a Custom… option; no more free-text guessing - /api/health ui -> studio-v4-light; badge shows "studio · v4" Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>ae69acb -
Web: redesign into a two-pane studio (sidebar + results, examples, history, tabs)
96kevinli29 +1: Claude Opus 4.8- left sidebar: problem input + controls, clickable example chips, session history - empty state with example cards; richer header with logo, status dot, model - results: answer banner with Python/Lean verified badge, metric cards (model/tokens/cost/time/calls), and tabbed Solution / Process / LaTeX (copy + downloads) - /api/health ui bumped to studio-v3 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>c69e694 -
Web: model picker dropdown (curated OpenRouter math models + custom)
96kevinli29 +1: Claude Opus 4.8- /api/models returns a curated list of strong math models (with price hints) plus the resolved server default - UI replaces the free-text model box with a <select> populated from /api/models; a "Custom…" option reveals a text field for any LiteLLM model id - verified: selecting a model overrides per-request (solve runs on the chosen model) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>cd1d3b2 -
Web: no-store cache headers + visible version badge so the new UI can't be cached stale
96kevinli29 +1: Claude Opus 4.8- serve index.html and /api/health with Cache-Control: no-store (was: browser cached the old sparse page over the SSH tunnel) - /api/health reports ui: "transparent-v2"; header shows a "transparent UI · v2" badge so old vs new is obvious at a glance Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>bc08cdb -
Web UI transparency: show model, token usage + cost, elapsed, and process timeline
96kevinli29 +1: Claude Opus 4.8- provider returns total_tokens + best-effort USD cost (LiteLLM _hidden_params) - MathAgent accumulates per-run usage (last_usage) and records a step timeline: each model turn (with reasoning + tokens) and every tool call (code + output) - /api/solve returns model, elapsed_s, usage, and steps; /api/health shows the resolved model name - redesigned chat UI: stats bar (model · tokens in→out · cost · time · calls), rendered solution, downloads, and a vertical process timeline with a live timer Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>d05655e -
Finish end-to-end: docx output, installable package, hardened eval, Lean guided-install
96kevinli29 +1: Claude Opus 4.8- docx output now works out of the box (pypandoc-binary bundled pandoc) - pip-installable: seed workspace bundled in package, auto-materialized on first run; fastapi/uvicorn/pandoc promoted to core deps so CLI+web+docx work on install - hardened answer grading (LaTeX spaces, \dfrac->fraction, ^->**, order-free lists, sympy-equality fallback): real seed set now scores 6/6 - Lean is an optional capability with guided install (`mathagent install-lean`) - verified end-to-end with a real model (Sonnet 4.6 via OpenRouter), CLI + web Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>ffb4d59 -
mathagent: end-to-end math problem-solving / proof agent on A-Evolve
96kevinli29 +1: Claude Opus 4.8Brain via LiteLLM (multi-provider), optional Python (sympy) and Lean verification capabilities, LaTeX/PDF/docx output, and a self-improving (verifier-grounded, git-tracked) evolution loop. CLI + FastAPI web UI share one MathAgent core. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>9aff26e