Skip to content

Dev#370

Open
Chenglong-MS wants to merge 30 commits into
mainfrom
dev
Open

Dev#370
Chenglong-MS wants to merge 30 commits into
mainfrom
dev

Conversation

@Chenglong-MS

Copy link
Copy Markdown
Collaborator

Made some good updates, but a little bit busy to write about it... so let's make the pr simple

This pull request introduces several significant improvements and cleanups to the Data Formulator agent codebase, focusing on agent configuration, chart restyling, and code explanation. It removes deprecated agents, adds robust validation for chart UI controls, and clarifies formula formatting in code explanations. The changes aim to improve reliability, maintainability, and security, especially around LLM-generated UI controls.

Agent configuration and cleanup:

  • Replaces deprecated agents (data_agent, report_gen, experience_distill) with updated or renamed agents (analyst, workflow_distill) in agent_config.py, reflecting the current production agent roster.
  • Removes unused agent imports and the entire ChartInsightAgent from the codebase, further cleaning up the agent registry and code. [1] [2]

Chart restyling and LLM UI controls:

  • Expands the agent_chart_restyle.py system prompt to support a new configUI field, allowing LLMs to propose safe, declarative UI controls for chart variants. The prompt now includes detailed rules and examples for these controls.
  • Implements _sanitize_config_ui, a robust validator that ensures LLM-authored configUI controls are well-formed, have safe paths (no prototype pollution), and meet type requirements before returning them to the frontend. [1] [2]

Formula formatting and code explanation:

  • Clarifies and enforces the format for code explanations: code-style formulas (with literal field names and no escaping) are the default, while LaTeX is reserved for genuine math notation. Removes previous instructions to escape underscores in LaTeX, and updates examples accordingly. [1] [2] [3]

Documentation and evaluation:

  • Adds a detailed evaluation plan for benchmarking open-source (Ollama) models, specifying axes of measurement, dataset splits, and reporting requirements.
  • Updates terminology in data loading chat agent to refer to "workflows" instead of "experiences".

Chenglong-MS and others added 30 commits May 28, 2026 22:03
1. Add custom property support for height , label , and sx to AnvilLoader
2. Replace globally hardcoded loading text with customizable label parameter
3. Optimize loading overlay styles with new frosted glass background effect
4. Unify loading state display in App.tsx and VisualizationView
…support

Introduce MiniAnalystAgent, a single-decision, low-cost variant of the analyst
agent that emits the same frontend streaming event contract (visualize / explain)
as the standard agent, so it is a drop-in replacement selectable from the UI.

- analyst/mini_agent.py: MiniAnalystAgent (subclass of AnalystAgent). One turn:
  decide -> either "visualize" (data-transform code + chart spec, committed via the
  shared core-skill dispatch so action/result events are identical to the standard
  agent) or "explain" (free-form text surfaced via the frontend Pure-Q&A path).
  Optional one-shot data inspection; JSON action contract for small/local models.
- routes/agents.py: agent_mode switch to swap AnalystAgent <-> MiniAnalystAgent.
- src/app/App.tsx, dfSlice.tsx, SimpleChartRecBox.tsx: frontend mini-mode toggle,
  miniMode redux state, and agent_mode in the analyst streaming request body.
- agents/client_utils.py: open-model (Ollama) enablement -- replay buffered
  responses as streaming chunks, salvage JSON tool calls emitted as plain content,
  and retry without reasoning_effort for models that lack "think" support.
- analyst/agent.py: tolerate non-string chart encodings from weak models
  (repairable "field not found" instead of an unhashable-type crash).
- analyst/__init__.py: export MiniAnalystAgent.
- tests: test_mini_agent.py (23) and test_client_utils.py additions; all green.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The mini_notool variant (MiniAnalystAgent with allow_inspection=False: a no-tools, one-shot ablation used only in evaluation) is removed. MiniAnalystAgent now always offers the single optional inspection before committing its answer; the per-turn inspection-budget logic in _decide/_mini_tools is unchanged. Tests updated to drop the no-tool-variant cases.
Replace the long-form README with a condensed plan.md (high-level goal and steps). The detailed report (report.md) and working artifacts (work/) remain local-only and are intentionally untracked.
@Chenglong-MS Chenglong-MS requested a review from zhb-ai June 24, 2026 05:33
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.

3 participants