Spaces:
Sleeping
Sleeping
Commit History
-
Fix parallel-research display: per-call stats in CLI and web UI (#49)
Aksel Joonas Reedi +1: lee101Unverified signatureWhen multiple research sub-agents ran concurrently, the CLI collapsed them into a single flickering slot and every web-UI tool card showed the aggregate across all agents — so 3 parallel calls looked like 1. CLI (agent/utils/terminal_display.py): - Replace the global SubAgentDisplay singleton with SubAgentDisplayManager that tracks each agent by agent_id and renders one block per agent with independent (tool count · tokens · elapsed). - 4 rolling tool-call lines per agent (was 2). - When 2+ agents are live, switch to a compact one-line-per-agent layout (label + stats + most-recent tool). Detailed 4-line rolling view only when a single agent is active. Keeps the live region small enough to fit on one terminal page so cursor-up/erase doesn't drift when content would otherwise scroll into scrollback. - Clip every live-region line to terminal width (ANSI-aware) so a wrapped line can't corrupt the cursor-up math on narrow terminals. - On completion, erase the live block and f…5ab7c4e -
Strip provider_specific_fields from research sub-agent messages
LiteLLM's response Message carries internal fields (provider_specific_fields, reasoning_content) that the HF router's strict OpenAI schema rejects when echoed back in a follow-up request. Rebuild the assistant Message with only role / content / tool_calls before appending to the research history. Reproduced on MiniMaxAI/MiniMax-M2.7 (the reported failure) and verified the fix across MiniMax, Kimi, GLM, Claude Opus, and GPT-5 in a multi-turn tool-calling loop.a2e8010 -
Route HF inference through /v1 auto-router + add reasoning_effort knob
Users paste bare HF model ids (MiniMaxAI/MiniMax-M2.7, moonshotai/Kimi-K2.6) with an optional :fastest|cheapest|preferred|<provider> suffix; the router picks a provider and handles failover. /model does a live preflight against /v1/models and prints providers, pricing, context, tool support — warn-and- allow for unknowns with fuzzy suggestions. Friendly messages replace LiteLLM's raw traceback for model/provider mismatches, and the noisy 'Give Feedback' banner is suppressed. Adds a reasoning_effort config + /effort command (default high). OpenAI and Anthropic get the top-level param natively; HF router gets it via extra_body with minimal->low normalization for models like MiniMax M2 that require reasoning. Frontend + backend model selectors updated to the bare-id format.0a9e96d
-
Fall back to user HF token for router when INFERENCE_TOKEN is unset (#39)
Aksel Joonas Reedi +1: Claude Opus 4.7 (1M context)Unverified signatureThe HF router code path only read INFERENCE_TOKEN, which is the shared server-side key set on the hosted Space so inference is free for users. On the CLI / self-hosted path that env var is absent, so requests went out with no bearer token and the router returned 401 — surfaced to users as "Authentication failed" even with a valid HF_TOKEN (issue #36). Resolve api_key in this order: 1. INFERENCE_TOKEN env (unchanged Space behavior — shared billing) 2. session.hf_token (user's OAuth / CLI token) 3. HF_TOKEN env (belt-and-suspenders for CLI) Applied to _resolve_hf_router_params, research_tool._resolve_llm_params, and ContextManager.compact. Fixes #36 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>182ddee
-
Rename CLI entry and Space assets from ml-agent to ml-intern
ae4a534
-
Rewrite research workflow to lead with literature mining
Research sub-agent now starts from papers, not docs. Default workflow: anchor paper → citation graph crawl → read methodology sections → extract result-attributed recipes → validate datasets → then code. Output format requires ranked recipe table linking results to the exact dataset + method + hyperparams that produced them.3bf831e
-
Fix sandbox HF_TOKEN not available inside container
Secret was injected after the Space was already running, so the env var was never present in the container. Move secret injection to before the build/start cycle. Also bump OAuth token lifetime to 30 days.45e517a
-
Minimize S2 API calls: drop paper_details enrichment, add response cache, rate limit only with API key
84d6321 -
Add Semantic Scholar integration: citation graph, filtered search, snippet search, recommendations
Extends hf_papers with S2 backend: - citation_graph: references + citations with influence flags and intents - Smart search routing: date/category/citation filters via S2 bulk search - snippet_search: semantic full-text passage search across 12M+ papers - recommend: single/multi-paper recommendations with pos/neg examples - paper_details enriched with citation count, TL;DR, fields of study - Rate-limited S2 client with 2 retries on 429/5xx - Research prompt: paper analysis checklist, new tool guidance - Frontend shimmer labels for new operationsd81613f -
Use sandbox read endpoint for script resolution to avoid bash truncation
23be8d5 -
Remove outdated-API flagging line from research prompt
f91e520 -
Add SOTA-awareness to research sub-agent system prompt
bdd77ee -
Improve agent loop, tools, and research subagent for long-running autonomous tasks
- Add --no-stream and --max-iterations CLI flags for headless operation - Simplify context manager: remove staged pruning, track actual token usage - Add doom-loop detection and context budget to research subagent - Improve file tools: better enforcement, error messages, descriptions - Improve bash tool: longer timeouts, background execution guidance - Add training logging and HP sweep guidance to system prompt - Relax Python requirement to >=3.11 - Remove unused file_content_cache73882d9
-
Use Haiku 4.5 for research sub-agent
eba82cc -
Use Haiku for research sub-agent when main model is Anthropic
fd87f8e -
Research stats tick every second via background timer
9d8d295 -
Live research stats: tool count, tokens, elapsed time in header
a96af97 -
Revert "Sub-agent log: tool_name → output_preview on one line"
This reverts commit f362c920a30671ed78d07fa9ad8ad25f3b313005.a6c60ef -
Sub-agent log: tool_name → output_preview on one line
d1b62e5 -
Log 20-char output preview for sub-agent tool calls
53f2739 -
feat: add headless CLI mode with local filesystem tools and rich terminal rendering
- Add argparse-based headless mode: `python -m agent.main "prompt here"` - Local tool specs override sandbox /app references for CLI mode - System prompt injects CLI-specific context (working directory, no sandbox) - Extract streaming/non-streaming LLM call helpers with LLMResult dataclass - Add shimmer thinking animation (truecolor gradient sweep) - Progressive markdown rendering via rich Live display - Clean MCP shutdown sequence, suppress asyncio teardown noise - Add rich dependency to agent extras577ec48 -
Deduplicate file re-reads via content hashing for local and sandbox tools
6d4f619
-
fix: move import/signature validation to sandbox, keep host-side lightweight
edit_utils.py (host): removed import resolution and signature inspection that always failed because ML packages aren't installed on the host. Now only does syntax checks and training script heuristics. sandbox_client.py (sandbox server): added real signature inspection — imports the actual class, calls inspect.signature(), and checks kwargs against the real __init__ parameters. Catches invalid trainer kwargs before runtime since packages are installed in the sandbox.5f5c156 -
feat: emit tool_log events from research sub-agent for UI liveness
Without this, the UI shows "research tool called" then goes silent for 30-120s while the sub-agent runs internally. Now emits progress events: "Starting research sub-agent...", each tool call name, and "Research complete." — so the user sees what's happening.44be1d7 -
feat: add research sub-agent tool, slim down main agent system prompt
Adds a `research` tool that spawns a cheaper LLM in its own context window with read-only tools (github_find_examples, explore_hf_docs, etc.) and returns a concise summary. This keeps expensive research output out of the main agent's context. The system prompt's Phase 1 research section is replaced with a single `research({task, context})` call pattern — all the detailed research methodology (tool chains, correct patterns, examples) moves into the sub-agent's system prompt where it belongs.da0136f -
Improve tool output quality: ANSI stripping, tail-biased truncation, noise suppression
- Strip ANSI escape sequences from bash/job output (sandbox, local, jobs) - Switch to tail-biased truncation (25/75 head/tail split) so errors and final results are preserved instead of setup noise - Spill full output to temp file when truncated, with metadata telling the agent how to read specific sections via offset/limit - Add UV_NO_PROGRESS=1 and PYTHONWARNINGS env vars to suppress install progress and deprecation warnings at source - Add atomic file writes, fuzzy edit matching, and Python validation to sandbox server and local toolsc85e4f2
-
feat: cancel sandbox creation on user interrupt
Sandbox.create() now accepts a cancel_event checked during polling loops. When set, the partially-created Space is deleted and Sandbox.Cancelled is raised. _ensure_sandbox bridges the asyncio cancel signal to a threading event so the blocking create call can respond within ~5s. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>e7524a8 -
feat: kill sandbox processes and cancel HF jobs on user interrupt
When the user clicks cancel, long-running sandbox commands and HF jobs now actually stop instead of running to completion in the background. - Sandbox server: track PIDs with Popen, add /api/kill endpoint - Sandbox client: add kill_all() method - HF jobs: track running job IDs in session, cancel on interrupt - Agent loop: cleanup on cancel in both run_agent and exec_approval - exec_approval: add cancellation support (was completely missing) - Sandbox title: set descriptive name instead of inheriting template Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>3c91fc8
-
fix: retry sandbox API calls on transient failures
The _call method now retries up to 3 times with backoff (3s, 6s, 9s) on non-JSON responses and connection errors, which are common when the sandbox is waking from sleep. Timeouts and unexpected exceptions are not retried. Error messages now include HTTP status and response preview instead of raw JSON parse errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>c86aaa8 -
chore: double sandbox command timeouts
DEFAULT_TIMEOUT: 120→240s, MAX_TIMEOUT: 600→1200s, WAIT_TIMEOUT: 300→600s Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>aa0f54a -
chore: increase sandbox sleep_time to 45 min
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9cd534c
-
feat: CLI local mode, slash commands, interrupt support; remove lmnr; frontend fixes
CLI: - Add local tools (bash/read/write/edit) via local_tools.py for CLI mode - Add ToolRouter local_mode to use local tools instead of sandbox - Add slash commands: /help, /undo, /compact, /model, /yolo, /status - Add Ctrl+C interrupt support (single=cancel, double=exit) - Add HF token auto-loading from env/huggingface-cli - Add session_holder for interrupt/model/status access - Add Session.update_model() method Cleanup: - Remove lmnr dependency and all observe/Laminar references - Delete unused logo PNGs Frontend: - Show hardware pricing in tool approval UI - Add sandbox explanation text - Revert bash streaming to panel (caused issues) - Fix setPanelOutput to not force panel view Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>82b0c13
-
stream sandbox creation logs to tool output, fix hf_jobs final status race
9d1a532
-
fix: increase sandbox sleep_time to 1500s
5a188fd -
sync: org onboarding, model updates, sandbox cleanup, prompt fixes
5af3ab5 -
fix: buffer websocket events during disconnects and replay on reconnect
ca13fee
-
feat: resolve sandbox file paths and show tool description in status
- Extract resolve_sandbox_script utility in sandbox_tool.py to detect file paths and read content from sandbox via cat - Resolve script paths before sending approval_required event so the frontend receives actual file content for display and editing - Show tool description arg in status chip and activity bar instead of generic "running" / "Running bash" textae24efc -
fix: use user OAuth token for job creation (has job.write on org)
d644dff -
fix: route all HF token usage through session.hf_token from OAuth
Remove all os.environ.get("HF_TOKEN") fallbacks. Token now flows exclusively through OAuth -> session.hf_token -> tools. - Pass hf_token through Session -> ContextManager -> _get_hf_username - Add session param to docs, repo_files, repo_git handlers - Jobs use HF_ADMIN_TOKEN for creation, user token for job secrets - Remove HF_TOKEN env setup from backend/main.py - Remove module-level username cache (broken for multi-user)33f29a8 -
fix: pass user OAuth token to dataset inspection tool
061ebdc
-
fix: use correct HF API filter param and improve integration tests
b95477e -
feat: add hf_papers tool for paper discovery and reading
64bf289 -
fix: remove TRANSFORMERS_VERBOSITY from sandbox env
574496f -
feat: inject OAuth token as HF_TOKEN secret into sandbox Space
38ab4b6 -
feat: require sandbox_create approval before sandbox operations
642f202
-
fix: use OAuth token for sandbox creation instead of env HF_TOKEN
08153a8 -
feat: use hf_agent tool descriptions, hardware flavors, and default env
103298c -
feat: restore sandbox tools and proactive compaction
a644598 -
feat: merge HF Space improvements
79b2fcc -
rewording
ef41473