euron-code 1.4.0__tar.gz → 1.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {euron_code-1.4.0 → euron_code-1.5.0}/CHANGELOG.md +19 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/PKG-INFO +21 -4
- {euron_code-1.4.0 → euron_code-1.5.0}/README.md +20 -3
- {euron_code-1.4.0 → euron_code-1.5.0}/pyproject.toml +1 -1
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/__init__.py +1 -1
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/agent.py +37 -6
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/cli.py +35 -7
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/llm/__init__.py +48 -4
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/llm/setup.py +4 -1
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/prompts.py +4 -2
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/repl.py +22 -4
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/__init__.py +19 -6
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/oss.py +16 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/reuse.py +4 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/mock_gateway.py +21 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_bench_harness.py +33 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_qa_reuse_unrelated.py +4 -1
- euron_code-1.5.0/tests/test_v15_hosted_models.py +114 -0
- euron_code-1.5.0/tests/test_v15_reuse_off_subagent_hooks.py +115 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v4.py +5 -3
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v5.py +7 -4
- {euron_code-1.4.0 → euron_code-1.5.0}/.gitignore +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/LICENSE +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/__main__.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/activity.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/api.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/attachments.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/auth.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/builtin_skills/build-from-reference/SKILL.md +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/builtin_skills/explain-codebase/SKILL.md +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/builtin_skills/review/SKILL.md +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/builtin_skills/test-writer/SKILL.md +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/cache.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/checkpoints.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/config.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/context.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/contextforge/LICENSE +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/contextforge/__init__.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/contextforge/text.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/contextforge/toolout.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/credentials.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/doctor.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/documents.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/error_hints.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/errorlog.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/frontmatter.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/hooks.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/keys.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/knowledge.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/licensing.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/llm/anthropic.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/llm/base.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/llm/openai_compat.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/logo.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/markdown_view.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/memory.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/osscache.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/ossgithub.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/pathfix.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/permissions.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/progress.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/project_setup.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/repomap.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/rules.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/security_scan.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/sessions.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/skills.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/textsafe.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/background.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/base.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/db.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/document.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/erie.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/fs.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/ignore.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/normalize.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/pathfind.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/search.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/shell.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/skill.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/symbols.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/task.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/todo.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/tools/web.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/transcript.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/trust.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/ui.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/update_check.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/usage_view.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/src/euron_code/version_info.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/conftest.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/fake_providers.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/helpers.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/measure_floor.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/serve_helper.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/sim_long_session.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_agent_mock.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_api_shell.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_bench.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_cli_e2e.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_context_memory_sessions.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_dashboard_fixes.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_dashboard_fixes_102.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_db.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_erie.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_knowledge_security.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_markdown_view.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_oss_local.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_permissions.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_powershell_exit_codes.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_qa_attach_secrets.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_qa_long_task.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_qa_print_output.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_qa_yolo_outside.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_repl.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_reuse_honesty.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_search.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_textsafe.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_tools_fs.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_transcript_ui.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_update_check.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v111_user_reports.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v113_fix_path.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v11_byo.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v11_speed.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v11_tool_fixes.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v130_cut_writes.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v130_reliability.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v140_parity.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v2_rules_skills_hooks.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v2_tokens_shortcuts.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v2_usage_headers.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v31_security.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v3_accounts_value_setup.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v3_activity.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v3_attachments.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v3_context.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v3_live_repl.py +0 -0
- {euron_code-1.4.0 → euron_code-1.5.0}/tests/test_v3_single_login.py +0 -0
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.0 (2026-11-10)
|
|
4
|
+
|
|
5
|
+
Three Euron models, and the default is now a hosted model.
|
|
6
|
+
|
|
7
|
+
- Euron default is Claude Sonnet 5.5 (Anthropic), run by Euron. In our benchmark of student-style tasks it
|
|
8
|
+
passed 25 of 25 at a median of 13.7 s per task, and 3 of 3 SWE-bench Verified tasks. Euron fast is GPT-6 Luna (OpenAI): quicker and lighter.
|
|
9
|
+
Euron open is the model Euron Code used until now, run on Euron's own servers. Pick with `/model` (arrow keys),
|
|
10
|
+
`/model fast`, `/model open`, `/model default`, or `euron models use fast`. Your own models work as before.
|
|
11
|
+
- Euron's provider keys stay on Euron's servers: Euron Code still talks only to Euron with your Euron key. Your
|
|
12
|
+
code and prompts for a hosted model are processed by that model's provider (Anthropic or OpenAI).
|
|
13
|
+
- The status line and `/model` name the real model, and Euron Code answers honestly when you ask which model it
|
|
14
|
+
is, including after a switch.
|
|
15
|
+
- Hosted models have a daily allowance per account. When it is used up, Euron Code tells you once and
|
|
16
|
+
continues on Euron open until midnight IST; nothing stops. Your usual token allowance still applies.
|
|
17
|
+
- With `reuse.enabled` set to false, every open-source and Euron reuse tool is off, and no GitHub repository is
|
|
18
|
+
downloaded.
|
|
19
|
+
- Read-only and parallel sub-agents run your hooks (PreToolUse, PostToolUse) and permission rules, like the main
|
|
20
|
+
agent.
|
|
21
|
+
|
|
3
22
|
## 1.4.0 (2026-11-09)
|
|
4
23
|
|
|
5
24
|
Fewer wasted steps and fewer missed details, from a benchmark of real student-style tasks with hidden tests.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: euron-code
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.0
|
|
4
4
|
Summary: Euron Code: an agentic coding assistant in your terminal for Euron Plus and Super 30 students.
|
|
5
5
|
Project-URL: Homepage, https://euron.one/code-agent
|
|
6
6
|
Author-email: Euron <contact@euron.one>
|
|
@@ -188,6 +188,23 @@ https://euron.one/code-agent/usage.
|
|
|
188
188
|
- **Live progress.** While it works you see what it is doing, the time, tokens and an `esc to interrupt`
|
|
189
189
|
line, and you can keep typing (see below).
|
|
190
190
|
|
|
191
|
+
## Euron models
|
|
192
|
+
|
|
193
|
+
Euron Plus and Super 30 include three Euron models. Euron runs them; you only need your Euron login.
|
|
194
|
+
|
|
195
|
+
| Model | What it is | Pick it with |
|
|
196
|
+
| --- | --- | --- |
|
|
197
|
+
| Euron default | Claude Sonnet 5.5 by Anthropic. The strongest choice for real coding work. | `/model default` |
|
|
198
|
+
| Euron fast | GPT-6 Luna by OpenAI. Quick and light, good for small tasks. | `/model fast` |
|
|
199
|
+
| Euron open | An open model that Euron runs on its own servers. | `/model open` |
|
|
200
|
+
|
|
201
|
+
`euron models` lists them; `euron models use fast` makes one your default. Euron's provider keys stay on Euron's
|
|
202
|
+
servers. When you use Euron default or Euron fast, your prompts and the code Euron Code sends are processed by
|
|
203
|
+
that model's provider (Anthropic or OpenAI). Euron open keeps everything on Euron's own servers.
|
|
204
|
+
|
|
205
|
+
Euron default and Euron fast have a daily allowance per account. When it is used up, Euron Code says so once and
|
|
206
|
+
continues on Euron open until midnight IST. Your daily token allowance applies to every Euron model.
|
|
207
|
+
|
|
191
208
|
## Use your own model
|
|
192
209
|
|
|
193
210
|
> Available from **Euron Code 1.1.0**. Check yours with `euron version` (or `euron --version`, or `/version`
|
|
@@ -253,13 +270,13 @@ Built-in names that only need their key in the environment: `gemini` (`GEMINI_AP
|
|
|
253
270
|
|
|
254
271
|
| Where | Command |
|
|
255
272
|
|---|---|
|
|
256
|
-
| in a session | `/model` (pick with the arrow keys), `/model
|
|
273
|
+
| in a session | `/model` (pick with the arrow keys), `/model fast`, `/model open`, `/model default`, `/model <provider:model>`, `/model remove <provider>` |
|
|
257
274
|
| default for every run | `euron models use <provider:model>`, back with `euron models use euron` |
|
|
258
275
|
| one run | `euron --model <provider:model>` (also with `-p`) |
|
|
259
276
|
| see what is set up | `euron models` |
|
|
260
277
|
|
|
261
|
-
The conversation is kept when you switch. The status line shows which model answers:
|
|
262
|
-
own model's name. Your own model's context window is taken from its known size (or the `contextWindow` you
|
|
278
|
+
The conversation is kept when you switch. The status line shows which model answers: the Euron model's name
|
|
279
|
+
(for example "Euron default (Claude Sonnet 5.5)"), or your own model's name. Your own model's context window is taken from its known size (or the `contextWindow` you
|
|
263
280
|
gave in `euron models add`), up to `byoMaxContext` (128,000 tokens by default, because every step resends the
|
|
264
281
|
conversation on your bill). A model that cannot call tools is refused with a clear message.
|
|
265
282
|
|
|
@@ -122,6 +122,23 @@ https://euron.one/code-agent/usage.
|
|
|
122
122
|
- **Live progress.** While it works you see what it is doing, the time, tokens and an `esc to interrupt`
|
|
123
123
|
line, and you can keep typing (see below).
|
|
124
124
|
|
|
125
|
+
## Euron models
|
|
126
|
+
|
|
127
|
+
Euron Plus and Super 30 include three Euron models. Euron runs them; you only need your Euron login.
|
|
128
|
+
|
|
129
|
+
| Model | What it is | Pick it with |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| Euron default | Claude Sonnet 5.5 by Anthropic. The strongest choice for real coding work. | `/model default` |
|
|
132
|
+
| Euron fast | GPT-6 Luna by OpenAI. Quick and light, good for small tasks. | `/model fast` |
|
|
133
|
+
| Euron open | An open model that Euron runs on its own servers. | `/model open` |
|
|
134
|
+
|
|
135
|
+
`euron models` lists them; `euron models use fast` makes one your default. Euron's provider keys stay on Euron's
|
|
136
|
+
servers. When you use Euron default or Euron fast, your prompts and the code Euron Code sends are processed by
|
|
137
|
+
that model's provider (Anthropic or OpenAI). Euron open keeps everything on Euron's own servers.
|
|
138
|
+
|
|
139
|
+
Euron default and Euron fast have a daily allowance per account. When it is used up, Euron Code says so once and
|
|
140
|
+
continues on Euron open until midnight IST. Your daily token allowance applies to every Euron model.
|
|
141
|
+
|
|
125
142
|
## Use your own model
|
|
126
143
|
|
|
127
144
|
> Available from **Euron Code 1.1.0**. Check yours with `euron version` (or `euron --version`, or `/version`
|
|
@@ -187,13 +204,13 @@ Built-in names that only need their key in the environment: `gemini` (`GEMINI_AP
|
|
|
187
204
|
|
|
188
205
|
| Where | Command |
|
|
189
206
|
|---|---|
|
|
190
|
-
| in a session | `/model` (pick with the arrow keys), `/model
|
|
207
|
+
| in a session | `/model` (pick with the arrow keys), `/model fast`, `/model open`, `/model default`, `/model <provider:model>`, `/model remove <provider>` |
|
|
191
208
|
| default for every run | `euron models use <provider:model>`, back with `euron models use euron` |
|
|
192
209
|
| one run | `euron --model <provider:model>` (also with `-p`) |
|
|
193
210
|
| see what is set up | `euron models` |
|
|
194
211
|
|
|
195
|
-
The conversation is kept when you switch. The status line shows which model answers:
|
|
196
|
-
own model's name. Your own model's context window is taken from its known size (or the `contextWindow` you
|
|
212
|
+
The conversation is kept when you switch. The status line shows which model answers: the Euron model's name
|
|
213
|
+
(for example "Euron default (Claude Sonnet 5.5)"), or your own model's name. Your own model's context window is taken from its known size (or the `contextWindow` you
|
|
197
214
|
gave in `euron models add`), up to `byoMaxContext` (128,000 tokens by default, because every step resends the
|
|
198
215
|
conversation on your bill). A model that cannot call tools is refused with a clear message.
|
|
199
216
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "euron-code"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.5.0"
|
|
8
8
|
description = "Euron Code: an agentic coding assistant in your terminal for Euron Plus and Super 30 students."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -197,7 +197,7 @@ class Agent:
|
|
|
197
197
|
if is_subagent and subagent_mode == "write":
|
|
198
198
|
self.tools = default_tools(settings, subagents=False)
|
|
199
199
|
else:
|
|
200
|
-
self.tools = read_only_tools() if is_subagent else default_tools(settings)
|
|
200
|
+
self.tools = read_only_tools(settings) if is_subagent else default_tools(settings)
|
|
201
201
|
self.tool_map = {t.name: t for t in self.tools}
|
|
202
202
|
self.tool_schemas = [t.schema() for t in self.tools]
|
|
203
203
|
if self.window <= SMALL_WINDOW:
|
|
@@ -210,6 +210,7 @@ class Agent:
|
|
|
210
210
|
self.tokens = context.TokenTracker()
|
|
211
211
|
self.cancel = threading.Event()
|
|
212
212
|
self.pending_note: Optional[str] = None
|
|
213
|
+
self._notices_shown: set = set() # gateway notices (hosted budget / fallback) already shown
|
|
213
214
|
self.pending_context: List[str] = [] # hook output, `!` commands: added to the next prompt
|
|
214
215
|
self.pending_images: List[Dict[str, Any]] = [] # image_url parts for the next prompt
|
|
215
216
|
self.pending_image_paths: List[Path] = [] # their local files (a photo may belong on the page)
|
|
@@ -221,7 +222,9 @@ class Agent:
|
|
|
221
222
|
self.rules = rules.RuleSet([])
|
|
222
223
|
self.skills: Dict[str, skills.Skill] = {}
|
|
223
224
|
self.system_parts: Dict[str, str] = {}
|
|
224
|
-
|
|
225
|
+
# sub-agents get the user's hooks too (their tool calls run PreToolUse / PostToolUse like the main
|
|
226
|
+
# agent's); SessionStart, UserPromptSubmit and Stop stay with the main agent (_run_hooks)
|
|
227
|
+
self.hooks = hooks
|
|
225
228
|
self.checkpoints = Checkpoints()
|
|
226
229
|
self.steps = 0 # model steps this session ("turn N" in read dedupe notes)
|
|
227
230
|
self.on_usage: Optional[Callable[[], None]] = None
|
|
@@ -283,16 +286,21 @@ class Agent:
|
|
|
283
286
|
|
|
284
287
|
@property
|
|
285
288
|
def model_label(self) -> str:
|
|
286
|
-
"""What the user sees:
|
|
289
|
+
"""What the user sees: the Euron model's label (it names the real model), or the third-party model's
|
|
290
|
+
real name."""
|
|
287
291
|
from euron_code import llm as _llm
|
|
288
|
-
return _llm.
|
|
292
|
+
return _llm.euron_label(self.model) if self.uses_euron else str(getattr(self.llm, "label", None) or self.model)
|
|
289
293
|
|
|
290
294
|
def set_model(self, model: str, backend, window: Optional[int] = None, max_output: Optional[int] = None) -> None:
|
|
291
295
|
"""Switch who answers (the next model call uses it). The conversation is kept: it is stored in one
|
|
292
296
|
neutral format and converted per provider."""
|
|
293
297
|
old = self.llm
|
|
298
|
+
changed = model != self.model
|
|
294
299
|
self.llm = backend
|
|
295
300
|
self.model = model
|
|
301
|
+
if changed and len(self.messages) > 1 and not self.is_subagent:
|
|
302
|
+
# honest identity: the next message tells the model who is answering from now on
|
|
303
|
+
self.pending_note = f"[Euron Code: from now on the model answering is {self.model_label}.]"
|
|
296
304
|
if window:
|
|
297
305
|
self.window = int(window)
|
|
298
306
|
self.settings["contextWindow"] = int(window)
|
|
@@ -512,7 +520,7 @@ class Agent:
|
|
|
512
520
|
text = self.pending_note + "\n\n" + text
|
|
513
521
|
self.pending_note = None
|
|
514
522
|
if len(self.messages) == 1 and not self.is_subagent:
|
|
515
|
-
text = prompts.dynamic_context(self.root, _branch(self.root)) + "\n\n" + text
|
|
523
|
+
text = prompts.dynamic_context(self.root, _branch(self.root), self.model_label) + "\n\n" + text
|
|
516
524
|
# volatile additions go at the END of the message, so everything before stays cacheable
|
|
517
525
|
if self.pending_context:
|
|
518
526
|
text += "\n\n" + "\n\n".join(self.pending_context)
|
|
@@ -987,6 +995,23 @@ class Agent:
|
|
|
987
995
|
f"{self.context_usage():,} tokens est.).")
|
|
988
996
|
return cut
|
|
989
997
|
|
|
998
|
+
def _gateway_note(self, info: Dict[str, Any]) -> None:
|
|
999
|
+
"""A note from the Euron gateway on a stream chunk, e.g. the hosted model's daily allowance is used up
|
|
1000
|
+
and this step ran on the Euron open model. Shown once per kind per session."""
|
|
1001
|
+
notice = info.get("notice") if isinstance(info.get("notice"), dict) else None
|
|
1002
|
+
if not notice:
|
|
1003
|
+
return
|
|
1004
|
+
key = str(notice.get("code") or "notice")
|
|
1005
|
+
if key in self._notices_shown:
|
|
1006
|
+
return
|
|
1007
|
+
self._notices_shown.add(key)
|
|
1008
|
+
msg = str(notice.get("message") or "").strip()
|
|
1009
|
+
if msg and not self.is_subagent:
|
|
1010
|
+
try:
|
|
1011
|
+
self.ui.warn(msg)
|
|
1012
|
+
except Exception:
|
|
1013
|
+
pass
|
|
1014
|
+
|
|
990
1015
|
def _wait(self, seconds: float, message: str) -> None:
|
|
991
1016
|
self.ui.end_response()
|
|
992
1017
|
self._phase(f"{message.rstrip('.')} - retrying in {seconds:.0f}s")
|
|
@@ -1112,6 +1137,8 @@ class Agent:
|
|
|
1112
1137
|
r.usage = chunk["usage"]
|
|
1113
1138
|
if isinstance(chunk.get("_provider_message"), dict):
|
|
1114
1139
|
r.extra = chunk["_provider_message"]
|
|
1140
|
+
if isinstance(chunk.get("euron"), dict):
|
|
1141
|
+
self._gateway_note(chunk["euron"])
|
|
1115
1142
|
for choice in chunk.get("choices") or []:
|
|
1116
1143
|
delta = choice.get("delta") or {}
|
|
1117
1144
|
reasoning = delta.get("reasoning") or delta.get("reasoning_content")
|
|
@@ -2107,6 +2134,10 @@ class Agent:
|
|
|
2107
2134
|
def _run_hooks(self, event: str, payload: Dict[str, Any], tool_name: Optional[str] = None):
|
|
2108
2135
|
if self.hooks is None:
|
|
2109
2136
|
return []
|
|
2137
|
+
if self.is_subagent:
|
|
2138
|
+
from euron_code.hooks import TOOL_EVENTS
|
|
2139
|
+
if event not in TOOL_EVENTS: # session / prompt / stop hooks belong to the main agent's turn
|
|
2140
|
+
return []
|
|
2110
2141
|
results = self.hooks.run(event, payload, tool_name)
|
|
2111
2142
|
for r in results:
|
|
2112
2143
|
if r.code not in (0, 2):
|
|
@@ -2631,7 +2662,7 @@ class Agent:
|
|
|
2631
2662
|
try:
|
|
2632
2663
|
sub = Agent(self.client, sub_ui, self.root, self.settings, self.permissions, self.model,
|
|
2633
2664
|
is_subagent=True, max_turns=SUBAGENT_STEPS[mode], llm=llm, subagent_mode=mode,
|
|
2634
|
-
write_scope=scope)
|
|
2665
|
+
write_scope=scope, hooks=self.hooks)
|
|
2635
2666
|
sub.window, sub.max_output = self.window, self.max_output
|
|
2636
2667
|
sub.cancel = self.cancel
|
|
2637
2668
|
sub.on_session_in_use = self.on_session_in_use
|
|
@@ -293,25 +293,50 @@ def run_models(ui, args) -> int:
|
|
|
293
293
|
if not args.name:
|
|
294
294
|
ui.error("Which model? e.g. `euron models use openai:<model>`, or `euron models use euron`.")
|
|
295
295
|
return EXIT_USAGE
|
|
296
|
-
|
|
296
|
+
name = args.name
|
|
297
|
+
short = llm.resolve_euron_shortcut(name.split(":", 1)[-1] if name.lower().startswith("euron:") else name)
|
|
298
|
+
if short is not None:
|
|
299
|
+
name = "euron:" + short if short else "euron"
|
|
300
|
+
ref = llm.parse(name)
|
|
297
301
|
if not ref.is_euron:
|
|
298
302
|
try:
|
|
299
303
|
llm.provider_config(ref.provider)
|
|
300
304
|
except llm.ProviderError as e:
|
|
301
305
|
ui.error(e.message)
|
|
302
306
|
return EXIT_USAGE
|
|
303
|
-
setup.set_default(str(ref) if not ref.is_euron else "euron")
|
|
307
|
+
setup.set_default(str(ref) if not ref.is_euron or ref.model else "euron")
|
|
304
308
|
ui.info(f"Default model: {llm.display_name(ref)}.")
|
|
305
309
|
return EXIT_OK
|
|
306
310
|
rows = setup.describe()
|
|
307
311
|
current = config.load_user_settings().get("model")
|
|
312
|
+
gw: list = []
|
|
313
|
+
try: # the Euron models (labels name the real model); offline or logged out: one generic row
|
|
314
|
+
client = _need_client(ui)
|
|
315
|
+
try:
|
|
316
|
+
gw = [m for m in client.models() if m.get("display_name")]
|
|
317
|
+
finally:
|
|
318
|
+
client.close()
|
|
319
|
+
llm.remember_euron_models(gw)
|
|
320
|
+
except api.EuronError:
|
|
321
|
+
gw = []
|
|
308
322
|
if args.json:
|
|
309
|
-
print(json.dumps({"default": llm.display_name(current), "
|
|
310
|
-
{"model":
|
|
323
|
+
print(json.dumps({"default": llm.display_name(current), "euron": [
|
|
324
|
+
{"model": "euron:" + str(m["id"]), "label": m.get("display_name"), "kind": m.get("kind"),
|
|
325
|
+
"accountDefault": bool(m.get("is_default"))} for m in gw],
|
|
326
|
+
"models": [{"model": r, "note": n} for r, n in rows]}, indent=2))
|
|
311
327
|
return EXIT_OK
|
|
312
328
|
ui.info(f"Default: [bold]{llm.display_name(current)}[/bold]")
|
|
313
|
-
|
|
314
|
-
|
|
329
|
+
cur_ref = llm.parse(current)
|
|
330
|
+
if gw:
|
|
331
|
+
for m in gw:
|
|
332
|
+
mid = str(m["id"])
|
|
333
|
+
on = cur_ref.is_euron and (cur_ref.model == mid or (not cur_ref.model and m.get("is_default")))
|
|
334
|
+
ui.plain(f" {'*' if on else ' '} euron:{mid} {m['display_name']}"
|
|
335
|
+
+ (" (account default)" if m.get("is_default") else ""))
|
|
336
|
+
ui.dim("Euron models need Euron Plus / Super 30. Shortcuts: euron:default, euron:fast, euron:open.")
|
|
337
|
+
else:
|
|
338
|
+
mark = "*" if llm.is_euron(current) else " "
|
|
339
|
+
ui.plain(f" {mark} euron {llm.EURON_LABEL} (Euron Plus / Super 30)")
|
|
315
340
|
for ref, note in rows:
|
|
316
341
|
ui.plain(f" {'*' if ref == current else ' '} {ref} {note}")
|
|
317
342
|
if not rows:
|
|
@@ -661,7 +686,9 @@ def choose_model(ui, args, settings, me, entitled: bool, interactive: bool):
|
|
|
661
686
|
ui.exact(api.NO_PLUS_BYO_MESSAGE)
|
|
662
687
|
return EXIT_NO_PLUS
|
|
663
688
|
if ref.is_euron:
|
|
664
|
-
|
|
689
|
+
short = llm.resolve_euron_shortcut(ref.model) if ref.model else None
|
|
690
|
+
model = (short if short is not None else ref.model) or me.get("defaultModel") or "euron-coder"
|
|
691
|
+
return model, None
|
|
665
692
|
try:
|
|
666
693
|
backend = llm.make_backend(ref, settings)
|
|
667
694
|
except llm.MissingKeyError as e:
|
|
@@ -694,6 +721,7 @@ def apply_model_limits(client, settings, model: str) -> None:
|
|
|
694
721
|
models = client.models()
|
|
695
722
|
except api.EuronError:
|
|
696
723
|
return
|
|
724
|
+
llm.remember_euron_models(models)
|
|
697
725
|
m = next((x for x in models if x.get("id") == model), None)
|
|
698
726
|
if not m:
|
|
699
727
|
return
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
A model reference is ``provider:model`` (``openai:gpt-5.1``, ``anthropic:claude-sonnet-5-5``,
|
|
4
4
|
``ollama:llama3.1:8b``, ``groq:llama-3.3-70b-versatile``). A reference without a provider, or ``euron``,
|
|
5
|
-
is
|
|
6
|
-
|
|
5
|
+
is a Euron model served by Euron's gateway. The gateway lists its models with a label that names the real
|
|
6
|
+
model (Euron default = Claude Sonnet 5.5, Euron fast = GPT-6 Luna, Euron open = Euron's own servers); the
|
|
7
|
+
provider keys stay on Euron's servers. ``euron:fast`` / ``euron:open`` / ``euron:default`` are shortcuts.
|
|
7
8
|
|
|
8
9
|
Providers come from built-in presets (PRESETS) merged with the user's own ``providers`` block in
|
|
9
10
|
~/.euron/settings.json (written by ``euron models add`` / ``/model add``). API keys come from the
|
|
@@ -22,6 +23,10 @@ from euron_code import api
|
|
|
22
23
|
|
|
23
24
|
EURON = "euron"
|
|
24
25
|
EURON_LABEL = "Euron model"
|
|
26
|
+
#: gateway models seen this run: id -> {"label", "kind", ...} (from /v1/models, see remember_euron_models)
|
|
27
|
+
_EURON_MODELS: Dict[str, Dict[str, Any]] = {}
|
|
28
|
+
#: shortcuts for the gateway's models: kind / role -> how to find the id
|
|
29
|
+
EURON_SHORTCUTS = ("default", "fast", "open")
|
|
25
30
|
#: Euron Plus / Super 30 only. Any signed-in Euron account may use its own model.
|
|
26
31
|
NEEDS_PLUS_MESSAGE = ("The Euron model needs Euron Plus or Super 30 (https://euron.one/plus). You can use your own "
|
|
27
32
|
"model instead: run /model add (or `euron models add`).")
|
|
@@ -109,10 +114,49 @@ def parse(ref: Optional[str]) -> ModelRef:
|
|
|
109
114
|
return ModelRef(EURON, s)
|
|
110
115
|
|
|
111
116
|
|
|
117
|
+
def remember_euron_models(models: List[Dict[str, Any]]) -> None:
|
|
118
|
+
"""Keep the gateway's model list (labels, kinds) for display. Older gateways send no labels."""
|
|
119
|
+
for m in models or []:
|
|
120
|
+
mid = str(m.get("id") or "")
|
|
121
|
+
if not mid:
|
|
122
|
+
continue
|
|
123
|
+
_EURON_MODELS[mid] = {"label": str(m.get("display_name") or m.get("label") or ""),
|
|
124
|
+
"kind": str(m.get("kind") or ""), "default": bool(m.get("is_default"))}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def euron_models() -> Dict[str, Dict[str, Any]]:
|
|
128
|
+
return dict(_EURON_MODELS)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def euron_label(model_id: str = "") -> str:
|
|
132
|
+
"""The label for a gateway model id ("" = the account default), else "Euron model"."""
|
|
133
|
+
if not model_id:
|
|
134
|
+
model_id = next((k for k, v in _EURON_MODELS.items() if v.get("default")), "")
|
|
135
|
+
info = _EURON_MODELS.get(model_id) or {}
|
|
136
|
+
return info.get("label") or EURON_LABEL
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def resolve_euron_shortcut(name: str, models: Optional[List[Dict[str, Any]]] = None) -> Optional[str]:
|
|
140
|
+
"""`fast` -> euron-fast, `open` -> the self-hosted model, `default` -> "" (the account default); None if
|
|
141
|
+
`name` is not a shortcut. Uses the gateway's list (kinds, ids), so new ids need no CLI change."""
|
|
142
|
+
n = (name or "").strip().lower()
|
|
143
|
+
if n not in EURON_SHORTCUTS:
|
|
144
|
+
return None
|
|
145
|
+
if n == "default":
|
|
146
|
+
return ""
|
|
147
|
+
if models is not None:
|
|
148
|
+
remember_euron_models(models)
|
|
149
|
+
items = list(_EURON_MODELS.items())
|
|
150
|
+
if n == "fast":
|
|
151
|
+
return next((k for k, _ in items if k == "euron-fast" or k.endswith("-fast")), "euron-fast")
|
|
152
|
+
return next((k for k, v in items if v.get("kind") == "open"), "euron-coder")
|
|
153
|
+
|
|
154
|
+
|
|
112
155
|
def display_name(ref: Any) -> str:
|
|
113
|
-
"""What the user sees:
|
|
156
|
+
"""What the user sees: the gateway's label for a Euron model (it names the real model), the real name for
|
|
157
|
+
a third-party model."""
|
|
114
158
|
r = ref if isinstance(ref, ModelRef) else parse(ref)
|
|
115
|
-
return
|
|
159
|
+
return euron_label(r.model) if r.is_euron else f"{r.provider}:{r.model}"
|
|
116
160
|
|
|
117
161
|
|
|
118
162
|
def is_euron(ref: Any) -> bool:
|
|
@@ -59,7 +59,10 @@ def save_provider(name: str, entry: Dict[str, Any], model: Optional[str] = None,
|
|
|
59
59
|
|
|
60
60
|
def set_default(ref: str) -> None:
|
|
61
61
|
data = config.load_user_settings()
|
|
62
|
-
|
|
62
|
+
r = llm.parse(ref)
|
|
63
|
+
if r.is_euron and r.model: # a specific Euron model (euron-fast, euron-coder): kept by its gateway id
|
|
64
|
+
data["model"] = r.model
|
|
65
|
+
elif r.is_euron: # the account default
|
|
63
66
|
data.pop("model", None)
|
|
64
67
|
else:
|
|
65
68
|
data["model"] = ref
|
|
@@ -49,7 +49,7 @@ CORE = """You are Euron Code, an AI coding agent that works inside the user's pr
|
|
|
49
49
|
- When you finish, summarise in a few lines what you changed (files, why) and how you verified it (command and result). Say plainly what you could not verify; never claim a check you did not run.
|
|
50
50
|
- If the request is ambiguous or risky, ask one clear question instead of guessing.
|
|
51
51
|
- Use Markdown sparingly: short paragraphs, `code` for names and paths, fenced blocks for code.
|
|
52
|
-
- If asked which AI model you are: you are Euron Code, running the model
|
|
52
|
+
- If asked which AI model you are: you are Euron Code, running the model named under "Model:" in the <context> block (or in a later "[Euron Code: ... the model answering is ...]" note). Name it plainly, with its vendor; do not guess any other model, vendor or hardware."""
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
SUBAGENT = """You are a read-only research sub-agent for Euron Code. You have read_file, list_dir, glob and grep, and nothing else: you cannot edit files or run commands.
|
|
@@ -219,9 +219,11 @@ def build_system_prompt(root: Path, shell_kind: str, memory_text: str, subagent:
|
|
|
219
219
|
return "\n\n".join(parts)
|
|
220
220
|
|
|
221
221
|
|
|
222
|
-
def dynamic_context(root: Path, branch: Optional[str]) -> str:
|
|
222
|
+
def dynamic_context(root: Path, branch: Optional[str], model_label: Optional[str] = None) -> str:
|
|
223
223
|
today = _dt.date.today().isoformat()
|
|
224
224
|
lines = [f"Today's date: {today}."]
|
|
225
|
+
if model_label:
|
|
226
|
+
lines.append(f"Model: {model_label}.")
|
|
225
227
|
if branch:
|
|
226
228
|
lines.append(f"Git branch: {branch}.")
|
|
227
229
|
return "<context>\n" + "\n".join(lines) + "\n</context>"
|
|
@@ -1448,11 +1448,26 @@ class Repl:
|
|
|
1448
1448
|
return None
|
|
1449
1449
|
|
|
1450
1450
|
def _model_options(self) -> List[tuple]:
|
|
1451
|
-
"""(ref, note) for the picker: the Euron
|
|
1451
|
+
"""(ref, note) for the picker: the Euron models first (default, fast, open, as the gateway lists
|
|
1452
|
+
them), then every model the user added."""
|
|
1452
1453
|
from euron_code.llm import setup
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1454
|
+
plus = "" if self.entitled else " (needs Euron Plus)"
|
|
1455
|
+
try:
|
|
1456
|
+
gw = self.client.models() if self.entitled else []
|
|
1457
|
+
except api.EuronError:
|
|
1458
|
+
gw = []
|
|
1459
|
+
llm.remember_euron_models(gw)
|
|
1460
|
+
labelled = [m for m in gw if m.get("display_name")]
|
|
1461
|
+
if labelled:
|
|
1462
|
+
cur = ("euron:" + self.agent.model) if self.agent.uses_euron else self.agent.model
|
|
1463
|
+
opts = []
|
|
1464
|
+
for m in labelled:
|
|
1465
|
+
ref = "euron:" + str(m["id"])
|
|
1466
|
+
note = str(m["display_name"]) + (", account default" if m.get("is_default") else "") + plus
|
|
1467
|
+
opts.append((ref, note + (", current" if ref == cur else "")))
|
|
1468
|
+
else: # an older gateway: one Euron model
|
|
1469
|
+
cur = self.agent.model if not self.agent.uses_euron else "euron"
|
|
1470
|
+
opts = [("euron", llm.EURON_LABEL + plus + (", current" if cur == "euron" else ""))]
|
|
1456
1471
|
for ref, note in setup.describe(self.agent.settings):
|
|
1457
1472
|
opts.append((ref, note + (", current" if ref == cur else "")))
|
|
1458
1473
|
if cur != "euron" and cur not in [o[0] for o in opts]:
|
|
@@ -1504,6 +1519,9 @@ class Repl:
|
|
|
1504
1519
|
return self._switch_model(arg)
|
|
1505
1520
|
|
|
1506
1521
|
def _switch_model(self, arg: str) -> None:
|
|
1522
|
+
short = llm.resolve_euron_shortcut(arg.split(":", 1)[-1] if arg.lower().startswith("euron:") else arg)
|
|
1523
|
+
if short is not None:
|
|
1524
|
+
arg = "euron:" + short if short else "euron"
|
|
1507
1525
|
ref = llm.parse(arg)
|
|
1508
1526
|
when = " It applies from the next model call of the running task." if self._running else ""
|
|
1509
1527
|
if ref.is_euron:
|
|
@@ -3,7 +3,7 @@ gateway's prefix cache."""
|
|
|
3
3
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
|
-
from typing import Any, Dict, List
|
|
6
|
+
from typing import Any, Dict, List, Optional
|
|
7
7
|
|
|
8
8
|
from euron_code.tools.base import Tool, ToolContext, ToolError, ToolResult, truncate
|
|
9
9
|
from euron_code.tools.background import CheckApp, ReadProcessOutput, StartBackgroundProcess, StopProcess
|
|
@@ -21,7 +21,20 @@ from euron_code.tools.task import Task
|
|
|
21
21
|
from euron_code.tools.todo import TodoWrite
|
|
22
22
|
from euron_code.tools.web import WebFetch
|
|
23
23
|
|
|
24
|
-
__all__ = ["Tool", "ToolContext", "ToolError", "ToolResult", "truncate", "default_tools", "read_only_tools"
|
|
24
|
+
__all__ = ["Tool", "ToolContext", "ToolError", "ToolResult", "truncate", "default_tools", "read_only_tools",
|
|
25
|
+
"REUSE_TOOLS"]
|
|
26
|
+
|
|
27
|
+
#: every tool that searches, reads or copies reusable code (Euron's repos or open source). reuse.enabled = false
|
|
28
|
+
#: removes them all from the tool list (each also refuses when called), so nothing is fetched in that mode.
|
|
29
|
+
REUSE_TOOLS = frozenset({"euron_reuse_search", "euron_reuse_read", "oss_search", "oss_tree", "oss_read",
|
|
30
|
+
"oss_fetch", "oss_grep", "oss_adopt", "find_reusable"})
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _without_reuse(tools: List[Tool], settings: Optional[Dict[str, Any]]) -> List[Tool]:
|
|
34
|
+
from euron_code.tools.erie import reuse_enabled
|
|
35
|
+
if settings is None or reuse_enabled(settings):
|
|
36
|
+
return tools
|
|
37
|
+
return [t for t in tools if t.name not in REUSE_TOOLS]
|
|
25
38
|
|
|
26
39
|
|
|
27
40
|
def default_tools(settings: Dict[str, Any], subagents: bool = True) -> List[Tool]:
|
|
@@ -39,9 +52,9 @@ def default_tools(settings: Dict[str, Any], subagents: bool = True) -> List[Tool
|
|
|
39
52
|
DeleteFile(), MoveFile(), ReuseSearch(), ReuseRead()]
|
|
40
53
|
tools += [OssSearch(), OssTree(), OssRead(), AddThirdPartyNotice(), FindReusable()]
|
|
41
54
|
tools += [OssFetch(), OssGrep(), OssAdopt()] # local-first open source (appended: keeps the prefix stable)
|
|
42
|
-
return tools
|
|
55
|
+
return _without_reuse(tools, settings)
|
|
43
56
|
|
|
44
57
|
|
|
45
|
-
def read_only_tools() -> List[Tool]:
|
|
46
|
-
return [ReadFile(), ListDir(), Glob(), Grep(), ReadDocument(), FindSymbol(), ReuseSearch(),
|
|
47
|
-
|
|
58
|
+
def read_only_tools(settings: Optional[Dict[str, Any]] = None) -> List[Tool]:
|
|
59
|
+
return _without_reuse([ReadFile(), ListDir(), Glob(), Grep(), ReadDocument(), FindSymbol(), ReuseSearch(),
|
|
60
|
+
ReuseRead(), OssSearch(), OssTree(), OssRead(), OssFetch(), OssGrep()], settings)
|
|
@@ -61,6 +61,16 @@ def _off(ctx) -> Optional[ToolResult]:
|
|
|
61
61
|
return None
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
def _reuse_off(ctx) -> Optional[ToolResult]:
|
|
65
|
+
"""reuse.enabled = false turns off every reuse tool, including reading a repo (cached or not):
|
|
66
|
+
nothing is fetched from GitHub or the gateway in that mode."""
|
|
67
|
+
from euron_code.tools.erie import reuse_enabled
|
|
68
|
+
if not reuse_enabled(ctx.settings):
|
|
69
|
+
return ToolResult("Reuse is turned off for this run (reuse.enabled = false). Write it yourself.",
|
|
70
|
+
preview="reuse off")
|
|
71
|
+
return None
|
|
72
|
+
|
|
73
|
+
|
|
64
74
|
def _local(ctx) -> bool:
|
|
65
75
|
from euron_code import ossgithub
|
|
66
76
|
return ossgithub.local_enabled(ctx.settings)
|
|
@@ -384,6 +394,9 @@ class OssTree(Tool):
|
|
|
384
394
|
|
|
385
395
|
def run(self, args, ctx):
|
|
386
396
|
from euron_code import api, osscache
|
|
397
|
+
off = _reuse_off(ctx)
|
|
398
|
+
if off:
|
|
399
|
+
return off
|
|
387
400
|
repo = require(args, "repo").strip()
|
|
388
401
|
path = str(args.get("path") or "").strip("/")
|
|
389
402
|
c = _cached(ctx, repo, fetch=False) if _valid(repo) else None
|
|
@@ -430,6 +443,9 @@ class OssRead(Tool):
|
|
|
430
443
|
|
|
431
444
|
def run(self, args, ctx):
|
|
432
445
|
from euron_code import api, osscache
|
|
446
|
+
off = _reuse_off(ctx)
|
|
447
|
+
if off:
|
|
448
|
+
return off
|
|
433
449
|
start = max(1, opt_int(args, "start", 1) or 1)
|
|
434
450
|
end = max(start, opt_int(args, "end", start + 199) or start + 199)
|
|
435
451
|
end = min(end, start + 399)
|
|
@@ -90,6 +90,10 @@ class ReuseRead(Tool):
|
|
|
90
90
|
|
|
91
91
|
def run(self, args, ctx):
|
|
92
92
|
from euron_code import api
|
|
93
|
+
from euron_code.tools.erie import reuse_enabled
|
|
94
|
+
if not reuse_enabled(ctx.settings):
|
|
95
|
+
return ToolResult("Reuse is turned off for this run (reuse.enabled = false). Write it yourself.",
|
|
96
|
+
preview="reuse off")
|
|
93
97
|
start = max(1, opt_int(args, "start", 1) or 1)
|
|
94
98
|
end = max(start, opt_int(args, "end", start + 199) or start + 199)
|
|
95
99
|
try:
|
|
@@ -133,6 +133,8 @@ class MockState:
|
|
|
133
133
|
self.sessions: Dict[str, set] = {}
|
|
134
134
|
self.tasks: Dict[str, set] = {}
|
|
135
135
|
self.cached: Dict[str, int] = {}
|
|
136
|
+
# gateway >= 2026-11-09: hosted Euron models with labels (euron-default / euron-fast / euron-coder)
|
|
137
|
+
self.hosted_models = False
|
|
136
138
|
|
|
137
139
|
def bump(self, key: str) -> int:
|
|
138
140
|
with self.lock:
|
|
@@ -515,6 +517,18 @@ class Handler(BaseHTTPRequestHandler):
|
|
|
515
517
|
if path == "/v1/models":
|
|
516
518
|
if not self._auth():
|
|
517
519
|
return
|
|
520
|
+
if self.state.hosted_models:
|
|
521
|
+
return self._send_json(200, {"object": "list", "data": [
|
|
522
|
+
{"id": "euron-default", "object": "model", "owned_by": "euron", "context_length": 128000,
|
|
523
|
+
"display_name": "Euron default (Claude Sonnet 5.5)", "kind": "hosted",
|
|
524
|
+
"max_output_tokens": 32000, "is_default": True},
|
|
525
|
+
{"id": "euron-fast", "object": "model", "owned_by": "euron", "context_length": 128000,
|
|
526
|
+
"display_name": "Euron fast (GPT-6 Luna)", "kind": "hosted", "max_output_tokens": 32000,
|
|
527
|
+
"is_default": False},
|
|
528
|
+
{"id": "euron-coder", "object": "model", "owned_by": "euron", "context_length": 32768,
|
|
529
|
+
"display_name": "Euron open (self-hosted)", "kind": "open",
|
|
530
|
+
"max_output_tokens": 8192, "is_default": False},
|
|
531
|
+
]})
|
|
518
532
|
return self._send_json(200, {"object": "list", "data": [
|
|
519
533
|
{"id": "euron-coder", "object": "model", "owned_by": "euron", "context_length": 32768,
|
|
520
534
|
"status": "ready"},
|
|
@@ -984,6 +998,13 @@ class Handler(BaseHTTPRequestHandler):
|
|
|
984
998
|
"choices": [{"index": 0, "delta": delta, "finish_reason": finish}]}
|
|
985
999
|
|
|
986
1000
|
try:
|
|
1001
|
+
if "[hosted:notice]" in json.dumps(body.get("messages") or [])[-4000:]:
|
|
1002
|
+
emit({"id": "euron-x", "object": "chat.completion.chunk", "model": "euron-coder", "choices": [],
|
|
1003
|
+
"euron": {"model": "euron-coder", "notice": {
|
|
1004
|
+
"code": "hosted_user_budget", "from": "euron-default",
|
|
1005
|
+
"to": "Euron open (self-hosted)",
|
|
1006
|
+
"message": "You have used today's Euron default (Claude Sonnet 5.5) allowance ($3.00). "
|
|
1007
|
+
"Euron Code continues on Euron open (Qwen3.6 27B, self-hosted) until 12:00 AM IST."}}})
|
|
987
1008
|
if scenario == "keepalive":
|
|
988
1009
|
for _ in range(3):
|
|
989
1010
|
emit(": keep-alive\n\n")
|