Spaces:
Running
Running
SilverElixir commited on
Commit ·
36d5fbb
1
Parent(s): 97aeb77
Add AGENTS.md with session instructions for OpenCode
Browse files
AGENTS.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AGENTS.md — instructions for OpenCode sessions on the Lumen repo
|
| 2 |
+
|
| 3 |
+
## Language and user context
|
| 4 |
+
- The user does not write code (the bot was built with Claude's help). Explain in Russian, in detail: what was done, why, and the result in plain terms.
|
| 5 |
+
|
| 6 |
+
## Agreement with the owner
|
| 7 |
+
- Small fixes and requested changes: do them right away. Large changes (new dependencies, behavior changes, restructuring, touching streaming or security layers): present a short plan first and get the owner's approval.
|
| 8 |
+
- Publishing (git commit/push, deploy to the HF Space, contacting the live bot): propose it, wait for explicit confirmation, never do it unprompted.
|
| 9 |
+
|
| 10 |
+
## What this repo is
|
| 11 |
+
- Lumen: a Telegram bot (persona styled after Claude) running as a single FastAPI + aiogram webhook service on a Hugging Face Space (Docker). LLM backbone: Google Gemini + free OpenRouter models with per-message routing.
|
| 12 |
+
- Entry point is bot.py (orchestrator, ~5000 lines). Focused modules sit next to it: lumen_router_config.py (model routing), lumen_formatting.py (markdown to Telegram HTML), lumen_security.py (injection/leak defenses), lumen_images.py, lumen_tts.py, lumen_tiktok.py, lumen_telegram_transport.py, lumen_state_storage.py, lumen_typing_pace.py, plus system_prompt.py.
|
| 13 |
+
|
| 14 |
+
## Commands (verified against CI, .github/workflows/ci.yml)
|
| 15 |
+
- Full gate: pip install -r requirements.txt -r requirements-dev.txt; pyflakes bot.py lumen_*.py system_prompt.py conftest.py test_*.py; pytest -q; pip-audit -r requirements.txt
|
| 16 |
+
- Single test file: pytest test_bot.py -v; single test: pytest test_bot.py::test_classify_model_error_rate_limit_by_status -v
|
| 17 |
+
- Proxy (Deno): deno test proxy_test.ts (no external imports, works offline; see proxy_test.ts header)
|
| 18 |
+
|
| 19 |
+
## Gotchas
|
| 20 |
+
- Every push to main that passes CI auto-deploys to the live HF Space (.github/workflows/sync-to-hf.yml waits for the CI workflow, then force-pushes the checked commit). A green CI run is a deploy.
|
| 21 |
+
- Versions in requirements.txt are pinned with == (HF rebuilds the image from scratch on every deploy; see the file header comment). Bumping a version is a deliberate decision followed by a manual smoke test (/diag + main commands), not a side effect.
|