mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-07-10 01:38:37 +00:00
Once request-level usage reporting is active, _send_agent_deactivate zeroes
deactivate_agent.tokens. Two consumers relied on that per-event field:
- single-agent SSE: _action_to_sse did not forward Action.request_usage, so
in single-agent mode request-level events were consumed and dropped while
the deactivate fallback was zeroed -> no real-time token updates (only the
final end.tokens backfilled the total). Forward request_usage like
chat_service does.
- question_confirm quick-reply detection (chatStore): read the zeroed
deactivate_agent.tokens, so hasTokens was always false and the quick-reply
"mark trigger execution Completed" branch never ran. Base it on the task's
accumulated total (getTokens) instead.
Verified:
- _action_to_sse(ActionRequestUsageData(tokens=123)) now emits
`data: {"step": "request_usage", ...}` (was None/dropped)
- backend tests: test_listen_chat_agent (15 passed, 1 skipped),
test_single_agent_service (1 passed)
- frontend chatStore tests unchanged (5 pre-existing getProjectById
failures, request_usage case passes)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| .vscode | ||
| app | ||
| benchmark | ||
| config | ||
| lang | ||
| scripts | ||
| tests | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| .python-version | ||
| babel.cfg | ||
| cli.py | ||
| main.py | ||
| messages.pot | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
# Option 1: Start with uvicorn directly
uv run uvicorn main:api --port 5001
# Option 2: Standalone mode (no Electron dependency)
uv run python main.py
# Option 3: If uv run hangs, delete lock files and retry, or use venv directly:
.venv/bin/python main.py
# or
.venv/bin/uvicorn main:api --port 5001 --host 0.0.0.0
# If uv hangs, delete lock files first: rm -f uv_installing.lock uv_installed.lock
Environment Variables (Standalone)
| Variable | Default | Description |
|---|---|---|
EIGENT_BRAIN_PORT |
5001 | Listening port |
EIGENT_BRAIN_HOST |
0.0.0.0 | Listening address |
EIGENT_DEBUG |
- | Set to 1/true to enable reload |
EIGENT_WORKSPACE |
~/.eigent/workspace | Working directory |
EIGENT_DEPLOYMENT_TYPE |
(auto) | local / cloud_vm / sandbox / docker; determines Hands capabilities (see ADR-0006) |
EIGENT_HANDS_MODE |
- | Set to remote to enable RemoteHands (remote cluster resource mode) |
EIGENT_HANDS_CLUSTER_CONFIG_FILE |
- | Path to RemoteHands config file (TOML); recommended |
EIGENT_HANDS_TERMINAL |
- | Override terminal hand: 1/true/yes or 0/false/no |
EIGENT_HANDS_BROWSER |
- | Override browser hand |
EIGENT_HANDS_FILESYSTEM |
- | Override filesystem scope: full / workspace_only |
EIGENT_HANDS_MCP |
- | Override MCP mode: all / allowlist |
RemoteHands config file example:
cp backend/config/hands_clusters.example.toml ~/.eigent/hands_clusters.toml
export EIGENT_HANDS_MODE=remote
export EIGENT_HANDS_CLUSTER_CONFIG_FILE=~/.eigent/hands_clusters.toml
i18n operation process: https://github.com/Anbarryprojects/fastapi-babel
pybabel extract -F babel.cfg -o messages.pot . --ignore-pot-creation-date # Extract multilingual strings from code to messages.pot file
pybabel init -i messages.pot -d lang -l zh_CN # Generate Chinese language pack, can only be generated initially, subsequent execution will cause overwrite
pybabel compile -d lang -l zh_CN # Compile language pack
pybabel update -i messages.pot -d lang
# -i messages.pot: Specify the input file as the generated .pot file
# -d translations: Specify the translation directory, which typically contains .po files for each language
# -l zh: Specify the language code
# regular search
\berror\b(?!\])