Commit Graph

8 Commits

Author SHA1 Message Date
Glevel 7804122b7e feat: add solve_task.py direct solver and fix MCP rate limit issues
- Add solve_task.py: fast direct solver (1 LLM call per task, no deepagents overhead)
- Add RetryOnRateLimitMiddleware: auto-retry on 429 from any tool
- Fix double MCP load: __init__.py cleared, pipeline reuses agent.py journal tools
- Fix proxy: add NO_PROXY for openrouter.ai, platform.brojs.ru, git.brojs.ru
- Add utility scripts: get_task_ids.py, read_tasks.py
- Update run_pipeline.py: TARGET_IDS support, unbuffered output

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 12:30:05 +03:00
Glevel 5f8b5b9144 add run/check scripts and revert llm to OpenRouter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 18:47:05 +03:00
Glevel 1d73c5e439 feat: pipeline guarantees task submission regardless of LLM tool calling
Added _force_submit() and _is_submitted() helpers. After the agent
finishes writing code, the pipeline checks if the task was actually
submitted. If not (LLM failed to call tools), the pipeline submits
directly via MCP — no LLM involved in the critical submit step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 22:57:24 +03:00
Glevel 7744a97012 chore: switch LLM from OpenRouter to BroJS Inference API
Token usage is now tracked on platform.brojs.ru.
Uses the same JOURNAL_TOKEN (jrnl_...) for both MCP and inference.
Removed OPENAI_API_KEY from .env.example.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 18:58:41 +03:00
Glevel 5f4737ce12 fix: syntax error in prompts.py (triple quotes inside triple quotes)
Changed homework_doing_instructions delimiter from """ to ''' to avoid
SyntaxError caused by docstrings inside code examples within the string.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 00:43:47 +03:00
Glevel 698ba21cfd improve: better prompts and rate-limit retry in pipeline
prompts.py:
- Added detailed technical patterns for deepagents, FastMCP, LangGraph,
  HumanInTheLoop, RAG with Qdrant, stream mode, text game
- LLM always via OpenRouter (never hub.pull/Ollama/hardcode)
- FastMCP correct pattern (module-level, NOT inside class)
- create_agent not compatible with AgentExecutor - documented
- DuckDuckGo search pattern (no API key needed)

pipeline.py:
- Added _invoke_with_retry: auto-retry on 429 rate limit (up to 5x, 90s backoff)
- Added TASK_PAUSE (15s) between tasks to reduce rate limit pressure
- Progress logging: per-task status messages
- Imported asyncio and re

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 00:35:02 +03:00
Glevel da0facfd4d fix: add __init__ to SanitizeToolCallsMiddleware
AgentMiddleware is a plain Generic class, not a Pydantic BaseModel,
so class-level field declarations don't work. Explicit __init__ required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 23:27:25 +03:00
Glevel c95d7375cc feat: initial brojs-agent implementation
AI-агент для автоматического выполнения заданий курса KFU-26-1.
Стек: deepagents + LangGraph + LangChain + OpenRouter (gpt-oss-20b:free).

- Главный агент-оркестратор с субагентами
- homework_direct_agent и rework_agent для сдачи/пересдачи
- Gitea REST API инструменты (git.brojs.ru/glevelll)
- BroJS Journal MCP клиент (platform.brojs.ru)
- LangGraph pipeline: последовательное выполнение всех заданий
- Middleware: SanitizeToolCalls + ValidateJournalWorkflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 23:08:14 +03:00