euron-code 1.3.1__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.
Files changed (139) hide show
  1. {euron_code-1.3.1 → euron_code-1.5.0}/CHANGELOG.md +39 -0
  2. {euron_code-1.3.1 → euron_code-1.5.0}/PKG-INFO +21 -4
  3. {euron_code-1.3.1 → euron_code-1.5.0}/README.md +20 -3
  4. {euron_code-1.3.1 → euron_code-1.5.0}/pyproject.toml +1 -1
  5. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/__init__.py +1 -1
  6. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/agent.py +137 -14
  7. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/cli.py +35 -7
  8. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/llm/__init__.py +48 -4
  9. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/llm/openai_compat.py +13 -0
  10. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/llm/setup.py +4 -1
  11. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/permissions.py +64 -3
  12. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/progress.py +1 -1
  13. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/prompts.py +12 -2
  14. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/repl.py +22 -4
  15. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/__init__.py +19 -6
  16. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/fs.py +2 -1
  17. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/oss.py +16 -0
  18. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/reuse.py +4 -0
  19. {euron_code-1.3.1 → euron_code-1.5.0}/tests/fake_providers.py +6 -0
  20. {euron_code-1.3.1 → euron_code-1.5.0}/tests/mock_gateway.py +21 -0
  21. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_bench_harness.py +77 -0
  22. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_qa_reuse_unrelated.py +4 -1
  23. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v11_byo.py +14 -0
  24. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v130_reliability.py +6 -1
  25. euron_code-1.5.0/tests/test_v140_parity.py +153 -0
  26. euron_code-1.5.0/tests/test_v15_hosted_models.py +114 -0
  27. euron_code-1.5.0/tests/test_v15_reuse_off_subagent_hooks.py +115 -0
  28. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v4.py +5 -3
  29. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v5.py +7 -4
  30. {euron_code-1.3.1 → euron_code-1.5.0}/.gitignore +0 -0
  31. {euron_code-1.3.1 → euron_code-1.5.0}/LICENSE +0 -0
  32. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/__main__.py +0 -0
  33. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/activity.py +0 -0
  34. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/api.py +0 -0
  35. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/attachments.py +0 -0
  36. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/auth.py +0 -0
  37. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/builtin_skills/build-from-reference/SKILL.md +0 -0
  38. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/builtin_skills/explain-codebase/SKILL.md +0 -0
  39. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/builtin_skills/review/SKILL.md +0 -0
  40. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/builtin_skills/test-writer/SKILL.md +0 -0
  41. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/cache.py +0 -0
  42. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/checkpoints.py +0 -0
  43. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/config.py +0 -0
  44. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/context.py +0 -0
  45. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/contextforge/LICENSE +0 -0
  46. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/contextforge/__init__.py +0 -0
  47. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/contextforge/text.py +0 -0
  48. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/contextforge/toolout.py +0 -0
  49. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/credentials.py +0 -0
  50. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/doctor.py +0 -0
  51. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/documents.py +0 -0
  52. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/error_hints.py +0 -0
  53. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/errorlog.py +0 -0
  54. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/frontmatter.py +0 -0
  55. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/hooks.py +0 -0
  56. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/keys.py +0 -0
  57. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/knowledge.py +0 -0
  58. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/licensing.py +0 -0
  59. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/llm/anthropic.py +0 -0
  60. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/llm/base.py +0 -0
  61. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/logo.py +0 -0
  62. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/markdown_view.py +0 -0
  63. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/memory.py +0 -0
  64. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/osscache.py +0 -0
  65. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/ossgithub.py +0 -0
  66. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/pathfix.py +0 -0
  67. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/project_setup.py +0 -0
  68. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/repomap.py +0 -0
  69. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/rules.py +0 -0
  70. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/security_scan.py +0 -0
  71. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/sessions.py +0 -0
  72. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/skills.py +0 -0
  73. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/textsafe.py +0 -0
  74. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/background.py +0 -0
  75. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/base.py +0 -0
  76. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/db.py +0 -0
  77. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/document.py +0 -0
  78. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/erie.py +0 -0
  79. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/ignore.py +0 -0
  80. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/normalize.py +0 -0
  81. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/pathfind.py +0 -0
  82. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/search.py +0 -0
  83. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/shell.py +0 -0
  84. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/skill.py +0 -0
  85. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/symbols.py +0 -0
  86. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/task.py +0 -0
  87. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/todo.py +0 -0
  88. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/tools/web.py +0 -0
  89. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/transcript.py +0 -0
  90. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/trust.py +0 -0
  91. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/ui.py +0 -0
  92. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/update_check.py +0 -0
  93. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/usage_view.py +0 -0
  94. {euron_code-1.3.1 → euron_code-1.5.0}/src/euron_code/version_info.py +0 -0
  95. {euron_code-1.3.1 → euron_code-1.5.0}/tests/conftest.py +0 -0
  96. {euron_code-1.3.1 → euron_code-1.5.0}/tests/helpers.py +0 -0
  97. {euron_code-1.3.1 → euron_code-1.5.0}/tests/measure_floor.py +0 -0
  98. {euron_code-1.3.1 → euron_code-1.5.0}/tests/serve_helper.py +0 -0
  99. {euron_code-1.3.1 → euron_code-1.5.0}/tests/sim_long_session.py +0 -0
  100. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_agent_mock.py +0 -0
  101. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_api_shell.py +0 -0
  102. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_bench.py +0 -0
  103. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_cli_e2e.py +0 -0
  104. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_context_memory_sessions.py +0 -0
  105. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_dashboard_fixes.py +0 -0
  106. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_dashboard_fixes_102.py +0 -0
  107. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_db.py +0 -0
  108. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_erie.py +0 -0
  109. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_knowledge_security.py +0 -0
  110. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_markdown_view.py +0 -0
  111. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_oss_local.py +0 -0
  112. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_permissions.py +0 -0
  113. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_powershell_exit_codes.py +0 -0
  114. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_qa_attach_secrets.py +0 -0
  115. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_qa_long_task.py +0 -0
  116. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_qa_print_output.py +0 -0
  117. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_qa_yolo_outside.py +0 -0
  118. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_repl.py +0 -0
  119. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_reuse_honesty.py +0 -0
  120. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_search.py +0 -0
  121. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_textsafe.py +0 -0
  122. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_tools_fs.py +0 -0
  123. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_transcript_ui.py +0 -0
  124. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_update_check.py +0 -0
  125. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v111_user_reports.py +0 -0
  126. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v113_fix_path.py +0 -0
  127. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v11_speed.py +0 -0
  128. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v11_tool_fixes.py +0 -0
  129. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v130_cut_writes.py +0 -0
  130. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v2_rules_skills_hooks.py +0 -0
  131. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v2_tokens_shortcuts.py +0 -0
  132. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v2_usage_headers.py +0 -0
  133. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v31_security.py +0 -0
  134. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v3_accounts_value_setup.py +0 -0
  135. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v3_activity.py +0 -0
  136. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v3_attachments.py +0 -0
  137. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v3_context.py +0 -0
  138. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v3_live_repl.py +0 -0
  139. {euron_code-1.3.1 → euron_code-1.5.0}/tests/test_v3_single_login.py +0 -0
@@ -1,5 +1,44 @@
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
+
22
+ ## 1.4.0 (2026-11-09)
23
+
24
+ Fewer wasted steps and fewer missed details, from a benchmark of real student-style tasks with hidden tests.
25
+
26
+ - Checks you write are no longer blocked. In bypass mode (`--yolo`), test code passed inline (`python -c`,
27
+ `node -e`, a heredoc or a PowerShell here-string) was refused as "outside the project" when it contained a URL
28
+ route (`/products`), a `//` comment, a division or a `~~~` fence. Real paths outside the project (your home
29
+ folder, another drive, `..\..`) still ask, as before.
30
+ - Optional edge-case review before a detailed task is called done (`"specReview": true` in settings): Euron Code
31
+ tests the request's formats, error cases, empty and boundary input once more and fixes what fails. Off by
32
+ default, because on the Euron model it added steps without catching more.
33
+ - Running a check script and deleting it afterwards counts as checked: Euron Code no longer redoes the check.
34
+ `tsx` and `ts-node` script runs count as checks.
35
+ - A folder with only a few config files (package.json, README) is shown in the first step, so a new build does
36
+ not start by listing and reading them.
37
+ - `edit_file` / `multi_edit` without a path uses the one file you have already seen that holds the text.
38
+ - A step that only updates the task list gets a one-line hint to send todo updates with the next real step.
39
+ - Your own models whose tools only work with reasoning turned off on chat completions now work: Euron Code
40
+ learns that from the first error instead of dropping the tools.
41
+
3
42
  ## 1.3.1 (2026-11-09)
4
43
 
5
44
  - A new build in an empty folder no longer gets the "here is every file in this small project" note (it only held
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: euron-code
3
- Version: 1.3.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 <provider:model>`, `/model euron`, `/model remove <provider>` |
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: "Euron model", or your
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 <provider:model>`, `/model euron`, `/model remove <provider>` |
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: "Euron model", or your
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.3.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"
@@ -1,3 +1,3 @@
1
1
  """Euron Code: an agentic coding assistant for the terminal."""
2
2
 
3
- __version__ = "1.3.1"
3
+ __version__ = "1.5.0"
@@ -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
- self.hooks = None if is_subagent else hooks
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
@@ -236,6 +239,8 @@ class Agent:
236
239
  self._reuse_nudged = False
237
240
  self._calls: Dict[tuple, int] = {}
238
241
  self._nudged = False
242
+ self._spec_reviewed = False # one rule-by-rule review of a detailed request before "done" (1.4.0)
243
+ self._todo_alone = 0 # steps whose only call was todo_write (1.4.0)
239
244
  self.guard = progress.ProgressGuard() # loops, stalls, edit-revert cycles (1.3.0)
240
245
  self._stuck = "" # why the guard stopped this request
241
246
  self._done_nudges = 0
@@ -281,16 +286,21 @@ class Agent:
281
286
 
282
287
  @property
283
288
  def model_label(self) -> str:
284
- """What the user sees: "Euron model", or the third-party model's real name."""
289
+ """What the user sees: the Euron model's label (it names the real model), or the third-party model's
290
+ real name."""
285
291
  from euron_code import llm as _llm
286
- return _llm.EURON_LABEL if self.uses_euron else str(getattr(self.llm, "label", None) or self.model)
292
+ return _llm.euron_label(self.model) if self.uses_euron else str(getattr(self.llm, "label", None) or self.model)
287
293
 
288
294
  def set_model(self, model: str, backend, window: Optional[int] = None, max_output: Optional[int] = None) -> None:
289
295
  """Switch who answers (the next model call uses it). The conversation is kept: it is stored in one
290
296
  neutral format and converted per provider."""
291
297
  old = self.llm
298
+ changed = model != self.model
292
299
  self.llm = backend
293
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}.]"
294
304
  if window:
295
305
  self.window = int(window)
296
306
  self.settings["contextWindow"] = int(window)
@@ -453,6 +463,8 @@ class Agent:
453
463
  from euron_code import errorlog
454
464
  errorlog.get().task_id = self.client.task_id
455
465
  self._nudged = False
466
+ self._spec_reviewed = False
467
+ self._todo_alone = 0
456
468
  self._placeholder_nudged = False
457
469
  self._notice_nudged = False
458
470
  for r in self._run_hooks("UserPromptSubmit", {"prompt": user_text}):
@@ -508,7 +520,7 @@ class Agent:
508
520
  text = self.pending_note + "\n\n" + text
509
521
  self.pending_note = None
510
522
  if len(self.messages) == 1 and not self.is_subagent:
511
- 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
512
524
  # volatile additions go at the END of the message, so everything before stays cacheable
513
525
  if self.pending_context:
514
526
  text += "\n\n" + "\n\n".join(self.pending_context)
@@ -672,6 +684,11 @@ class Agent:
672
684
  not done.startswith("[Euron Code: the last check") else
673
685
  "(the last check still fails; asking Euron Code to fix it)")
674
686
  continue
687
+ if self._needs_spec_review(user_text):
688
+ self._spec_reviewed = True
689
+ self._append({"role": "user", "content": prompts.SPEC_REVIEW_NUDGE})
690
+ self.ui.dim("(checking the result against your request once more)")
691
+ continue
675
692
  open_todos = [t for t in self.ctx.todos if isinstance(t, dict)
676
693
  and t.get("status") in ("pending", "in_progress")]
677
694
  if (open_todos and self.ctx.todos != todos_at_start and not todo_nudged and not self.is_subagent
@@ -978,6 +995,23 @@ class Agent:
978
995
  f"{self.context_usage():,} tokens est.).")
979
996
  return cut
980
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
+
981
1015
  def _wait(self, seconds: float, message: str) -> None:
982
1016
  self.ui.end_response()
983
1017
  self._phase(f"{message.rstrip('.')} - retrying in {seconds:.0f}s")
@@ -1103,6 +1137,8 @@ class Agent:
1103
1137
  r.usage = chunk["usage"]
1104
1138
  if isinstance(chunk.get("_provider_message"), dict):
1105
1139
  r.extra = chunk["_provider_message"]
1140
+ if isinstance(chunk.get("euron"), dict):
1141
+ self._gateway_note(chunk["euron"])
1106
1142
  for choice in chunk.get("choices") or []:
1107
1143
  delta = choice.get("delta") or {}
1108
1144
  reasoning = delta.get("reasoning") or delta.get("reasoning_content")
@@ -1171,6 +1207,13 @@ class Agent:
1171
1207
  except KeyboardInterrupt:
1172
1208
  content, outcome = "Interrupted by the user (Ctrl-C).", "interrupted"
1173
1209
  content, looping = self._guard_repeats(tc, content)
1210
+ if (tc["function"]["name"] == "todo_write" and len(tool_calls) == 1
1211
+ and not content.startswith("Error")):
1212
+ self._todo_alone += 1
1213
+ if self._todo_alone >= 2:
1214
+ # bench 2026-11-09: 6 of 32 SWE steps were todo_write alone; each one is a full model round trip
1215
+ content += ("\n[Euron Code: a step with only todo_write costs a full round trip. Send todo "
1216
+ "updates together with your next real tool call, and do not tick items off at the end.]")
1174
1217
  if self.pending_context and any(x.startswith("[Euron Code: you have edited") for x in self.pending_context):
1175
1218
  content += "\n\n" + "\n".join(x for x in self.pending_context if x.startswith("[Euron Code: you have edited"))
1176
1219
  self.pending_context = [x for x in self.pending_context if not x.startswith("[Euron Code: you have edited")]
@@ -1428,14 +1471,16 @@ class Agent:
1428
1471
  def _done_nudge(self) -> Optional[str]:
1429
1472
  """Definition of done: after the last change a real check (build / tests / running it) must pass. Up
1430
1473
  to MAX_DONE_NUDGES times the model is sent back: to run one, or to fix the one that fails."""
1431
- if (self.is_subagent or self._done_nudges >= MAX_DONE_NUDGES or not self.ledger["edits"]
1474
+ if (self.is_subagent or self._done_nudges >= MAX_DONE_NUDGES or not self._real_edits()
1432
1475
  or self.permissions.mode == "plan" or self.settings.get("verifyNudge", True) is False):
1433
1476
  return None
1434
1477
  if all(_DOC_RE.search(rel) for rel in self.files_changed()):
1435
1478
  return None # docs / notes only: nothing to build
1436
1479
  if self._verified():
1437
1480
  return None
1438
- last_edit = max(step for step, _ in self.ledger["edits"])
1481
+ last_edit = self._last_edit_step()
1482
+ if last_edit is None:
1483
+ return None
1439
1484
  after = [(c, code) for step, c, code in self.ledger["commands"] if step >= last_edit
1440
1485
  and progress.is_check_command(c)]
1441
1486
  if after and after[-1][1] != 0 and self._last_check:
@@ -1622,8 +1667,26 @@ class Agent:
1622
1667
  """About how many output tokens reused code saved: what was copied or adapted did not have to be written."""
1623
1668
  return sum(self._reuse_chars.get((r, p), 0) for r, p, _ in self.ledger.get("reused") or []) // 4
1624
1669
 
1670
+ def _scratch(self, rel: str) -> bool:
1671
+ """A file this session created and has deleted again (a _check.py): no change to the project."""
1672
+ path = self.root / rel
1673
+ try:
1674
+ return not path.exists() and self.ctx.tracker.created_here(path)
1675
+ except OSError:
1676
+ return False
1677
+
1678
+ def _real_edits(self) -> List[Tuple[int, str]]:
1679
+ return [(step, rel) for step, rel in self.ledger["edits"] if not self._scratch(rel)]
1680
+
1681
+ def _last_edit_step(self) -> Optional[int]:
1682
+ """The step of the last change that stays in the project. Bench 2026-11-09: write _check.py, run it
1683
+ (pass), delete it; the delete counted as the last edit, so the check "had not run" and the model was
1684
+ sent to redo it (3 wasted steps)."""
1685
+ steps = [step for step, _ in self._real_edits()]
1686
+ return max(steps) if steps else None
1687
+
1625
1688
  def files_changed(self) -> List[str]:
1626
- return list(dict.fromkeys(rel for _, rel in self.ledger["edits"]))
1689
+ return list(dict.fromkeys(rel for _, rel in self._real_edits()))
1627
1690
 
1628
1691
  # ---------------------------------------------------------- tiny projects: every file in the first message
1629
1692
  SNAPSHOT_MAX_FILES = 12
@@ -1659,8 +1722,12 @@ class Agent:
1659
1722
  return ""
1660
1723
  except OSError:
1661
1724
  return ""
1662
- if not any(_SOURCE_RE.search(p.name) for p in files):
1663
- return "" # nothing to change yet (a new build): the note would only confuse it (live 1.3.0)
1725
+ # A new build in a folder of a few config files (package.json, README, tsconfig): show them with a
1726
+ # neutral note, since "make the change" confused new builds (live 1.3.0), but list_dir + read_file
1727
+ # of package.json cost two round trips (bench 2026-11-09, js-form-validation-rules).
1728
+ new_build = not any(_SOURCE_RE.search(p.name) for p in files)
1729
+ if not files:
1730
+ return ""
1664
1731
  from euron_code.tools.fs import TO_END
1665
1732
  blocks: List[str] = []
1666
1733
  for p in files:
@@ -1675,6 +1742,9 @@ class Agent:
1675
1742
  blocks.append(f'<project-file path="{self.ctx.rel(p)}">\n{body}\n</project-file>')
1676
1743
  if not blocks:
1677
1744
  return ""
1745
+ if new_build:
1746
+ return ("\n\n[The folder has no source code yet. These are all its files, as on disk now (you have read "
1747
+ "them; do not list or read them again):]\n" + "\n".join(blocks))
1678
1748
  return ("\n\n[This project is small: here is every file in it, as on disk now (you have read them; do not "
1679
1749
  "list or read them again). Make the change, run the tests once, and stop when they pass.]\n"
1680
1750
  + "\n".join(blocks))
@@ -1806,17 +1876,62 @@ class Agent:
1806
1876
  return ", ".join(named[:6])
1807
1877
 
1808
1878
  def _verified(self) -> bool:
1809
- if not self.ledger["edits"]:
1879
+ last_edit = self._last_edit_step()
1880
+ if last_edit is None:
1810
1881
  return True
1811
- last_edit = max(step for step, _ in self.ledger["edits"])
1812
1882
  # a real check (tests, build, running it) after the last change, and the latest one passed;
1813
1883
  # 1.2.0 counted ANY exit 0, so `ls` after a broken build was "verified"
1814
1884
  after = [code for step, c, code in self.ledger["commands"] if step >= last_edit
1815
1885
  and progress.is_check_command(c)]
1816
1886
  return bool(after) and after[-1] == 0
1817
1887
 
1888
+ def _infer_edit_path(self, args: Dict[str, Any]) -> Optional[str]:
1889
+ """edit_file / multi_edit without `path` (bench 2026-11-09: a whole step lost to "Missing required
1890
+ parameter `path`"): when exactly ONE file this session read or wrote contains every old_string, it is
1891
+ that file. Never a guess between two files, never a file the model has not seen."""
1892
+ olds = [args.get("old_string")] if "edits" not in args else [
1893
+ e.get("old_string") for e in (args.get("edits") or []) if isinstance(e, dict)]
1894
+ olds = [o for o in olds if isinstance(o, str) and o.strip()]
1895
+ if not olds:
1896
+ return None
1897
+ seen = list(getattr(self.ctx.tracker, "files", {}).keys()) + [str(self.root / rel) for _, rel in
1898
+ self.ledger.get("edits") or []]
1899
+ hits: List[str] = []
1900
+ for key in dict.fromkeys(seen):
1901
+ path = Path(key)
1902
+ try:
1903
+ if not path.is_file() or path.stat().st_size > 2_000_000:
1904
+ continue
1905
+ text = path.read_text(encoding="utf-8", errors="replace")
1906
+ except OSError:
1907
+ continue
1908
+ if all(o.replace("\r\n", "\n") in text for o in olds): # read_text gives \n line ends
1909
+ rel = self.ctx.rel(path)
1910
+ if rel not in hits:
1911
+ hits.append(rel)
1912
+ return hits[0] if len(hits) == 1 else None
1913
+
1914
+ SPEC_REVIEW_MIN_CHARS = 350
1915
+
1916
+ def _needs_spec_review(self, user_text: str) -> bool:
1917
+ """A detailed request (a spec with rules, formats, error cases) whose code changed and whose checks
1918
+ pass: one look back at the request, rule by rule, before calling it done. Bench 2026-11-09: most of
1919
+ Euron's hidden-test failures were a rule of the request missed after its own tests passed (a constant
1920
+ that must be lowercase only, whitespace inside an expression, sorting, a header, list inputs).
1921
+ OPT-IN (`"specReview": true`): measured on the self-hosted model it cost 6-10 steps and the model
1922
+ adjusted its own asserts to match its bug, so it is off by default."""
1923
+ if (self.is_subagent or self._spec_reviewed or self.permissions.mode == "plan"
1924
+ or self.settings.get("specReview", False) is not True or not self._real_edits()):
1925
+ return False
1926
+ text = re.sub(r'<attached-file path="[^"]*">.*?</attached-file>', " ", user_text or "", flags=re.S)
1927
+ if len(text.strip()) < self.SPEC_REVIEW_MIN_CHARS:
1928
+ return False
1929
+ if all(_DOC_RE.search(rel) for rel in self.files_changed()):
1930
+ return False
1931
+ return self._verified()
1932
+
1818
1933
  def _needs_verify_nudge(self) -> bool:
1819
- return (not self.is_subagent and not self._nudged and bool(self.ledger["edits"])
1934
+ return (not self.is_subagent and not self._nudged and bool(self._real_edits())
1820
1935
  and self.permissions.mode != "plan" and self.settings.get("verifyNudge", True) is not False
1821
1936
  and not self._verified())
1822
1937
 
@@ -1880,6 +1995,10 @@ class Agent:
1880
1995
  args = normalize_args(args, getattr(tool, "parameters", None))
1881
1996
  except Exception: # repairing is best effort; the tool still validates
1882
1997
  pass
1998
+ if name in ("edit_file", "multi_edit") and isinstance(args, dict) and not args.get("path"):
1999
+ guess = self._infer_edit_path(args)
2000
+ if guess:
2001
+ args["path"] = guess
1883
2002
  if cut is not None:
1884
2003
  args["_partial"] = True # a file written in parts: no syntax check of its missing end
1885
2004
  try:
@@ -2015,6 +2134,10 @@ class Agent:
2015
2134
  def _run_hooks(self, event: str, payload: Dict[str, Any], tool_name: Optional[str] = None):
2016
2135
  if self.hooks is None:
2017
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 []
2018
2141
  results = self.hooks.run(event, payload, tool_name)
2019
2142
  for r in results:
2020
2143
  if r.code not in (0, 2):
@@ -2539,7 +2662,7 @@ class Agent:
2539
2662
  try:
2540
2663
  sub = Agent(self.client, sub_ui, self.root, self.settings, self.permissions, self.model,
2541
2664
  is_subagent=True, max_turns=SUBAGENT_STEPS[mode], llm=llm, subagent_mode=mode,
2542
- write_scope=scope)
2665
+ write_scope=scope, hooks=self.hooks)
2543
2666
  sub.window, sub.max_output = self.window, self.max_output
2544
2667
  sub.cancel = self.cancel
2545
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
- ref = llm.parse(args.name)
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), "models": [
310
- {"model": r, "note": n} for r, n in rows]}, indent=2))
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
- mark = "*" if llm.is_euron(current) else " "
314
- ui.plain(f" {mark} euron {llm.EURON_LABEL} (Euron Plus / Super 30)")
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
- return (ref.model or me.get("defaultModel") or "euron-coder"), None
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 the Euron model served by Euron's gateway, and is always shown as "Euron model": the model behind
6
- it is never named in output.
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: always "Euron model" for the gateway, the real name for a third-party model."""
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 EURON_LABEL if r.is_euron else f"{r.provider}:{r.model}"
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:
@@ -40,6 +40,9 @@ class OpenAICompatBackend:
40
40
  self._drop: set = set(cfg.get("dropParams") or [])
41
41
  self._rename: Dict[str, str] = {}
42
42
  self._drop_names = False # some servers reject `name` on tool messages
43
+ # OpenAI GPT-6 on chat/completions: "Function tools with reasoning_effort are not supported ... set
44
+ # reasoning_effort to 'none'" (2026-11-09). Learned once, then every request sends "none".
45
+ self._force_effort: Optional[str] = None
43
46
  # api.Client compatibility (the agent sets these; they are not sent anywhere)
44
47
  self.session_id: Optional[str] = None
45
48
  self.task_id: Optional[str] = None
@@ -71,6 +74,8 @@ class OpenAICompatBackend:
71
74
  if effort and (self.cfg.get("reasoningEffort") is True or
72
75
  (self.official and _REASONING_MODEL.match(self.model))):
73
76
  b["reasoning_effort"] = effort
77
+ if self._force_effort:
78
+ b["reasoning_effort"] = self._force_effort
74
79
  if stream:
75
80
  b["stream"] = True
76
81
  b["stream_options"] = {"include_usage": True}
@@ -87,7 +92,14 @@ class OpenAICompatBackend:
87
92
  """Learn from a 400 about a parameter. True when the request should be sent again."""
88
93
  if err.status not in (400, 422):
89
94
  return False
95
+ low_msg = (err.message or "").lower()
96
+ if (not self._force_effort and "reasoning_effort" in low_msg
97
+ and re.search(r"set\W+reasoning_effort\W+to\W+.?none", low_msg)):
98
+ self._force_effort = "none"
99
+ return True
90
100
  bad = base.unsupported_param(err.message, sent)
101
+ if bad in ("tools", "tool_choice"):
102
+ return False # without tools the agent cannot work: report the error instead of dropping them
91
103
  if not bad:
92
104
  low = (err.message or "").lower()
93
105
  if not self._drop_names and "messages" in low and re.search(r"\bname\b", low):
@@ -174,6 +186,7 @@ class OpenAICompatBackend:
174
186
  """A second connection (parallel sub-agents), keeping what this one learned about the server."""
175
187
  c = OpenAICompatBackend(self.provider, self.cfg, self.model, self._key, transport=self._transport)
176
188
  c._drop, c._rename, c._drop_names = set(self._drop), dict(self._rename), self._drop_names
189
+ c._force_effort = self._force_effort
177
190
  return c
178
191
 
179
192
  def close(self) -> None: