euron-code 1.7.2__tar.gz → 1.8.1__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.7.2 → euron_code-1.8.1}/CHANGELOG.md +40 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/PKG-INFO +18 -6
- {euron_code-1.7.2 → euron_code-1.8.1}/README.md +17 -5
- {euron_code-1.7.2 → euron_code-1.8.1}/pyproject.toml +1 -1
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/__init__.py +1 -1
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/agent.py +293 -24
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/api.py +31 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/cli.py +4 -1
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/config.py +73 -1
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/permissions.py +80 -7
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/progress.py +31 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/prompts.py +1 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/repl.py +75 -7
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/__init__.py +8 -2
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/ignore.py +75 -75
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/web.py +13 -0
- euron_code-1.8.1/src/euron_code/tools/websearch.py +125 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_permissions.py +91 -91
- euron_code-1.8.1/tests/test_v180_rescue_research_permissions.py +220 -0
- euron_code-1.8.1/tests/test_v181_silent_failures_verified.py +124 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/.gitignore +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/LICENSE +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/__main__.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/activity.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/attachments.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/auth.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/autoupdate.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/builtin_skills/build-from-reference/SKILL.md +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/builtin_skills/explain-codebase/SKILL.md +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/builtin_skills/review/SKILL.md +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/builtin_skills/test-writer/SKILL.md +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/cache.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/checkpoints.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/codeindex.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/context.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/contextforge/LICENSE +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/contextforge/__init__.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/contextforge/text.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/contextforge/toolout.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/credentials.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/ctxstats.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/doctor.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/documents.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/dotnet.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/error_hints.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/errorlog.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/failures.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/friendly.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/frontmatter.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/hooks.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/keys.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/knowledge.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/licensing.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/llm/__init__.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/llm/anthropic.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/llm/base.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/llm/openai_compat.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/llm/setup.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/logo.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/markdown_view.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/memory.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/migration.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/modes.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/mvc5.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/osscache.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/ossgithub.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/pasteinput.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/pathfix.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/project_setup.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/repomap.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/rules.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/security_scan.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/sessions.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/skills.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/taskstate.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/textsafe.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tls.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/background.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/base.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/db.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/document.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/erie.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/fs.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/normalize.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/oss.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/pathfind.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/port.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/reuse.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/search.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/shell.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/skill.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/symbols.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/task.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/tools/todo.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/transcript.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/trust.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/ui.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/update_check.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/usage_view.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/version_info.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/src/euron_code/webforms.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/conftest.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/fake_providers.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/helpers.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/measure_floor.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/mock_gateway.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/serve_helper.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/sim_long_session.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_agent_mock.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_api_shell.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_bench.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_bench_harness.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_cli_e2e.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_context_memory_sessions.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_dashboard_fixes.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_dashboard_fixes_102.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_db.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_erie.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_knowledge_security.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_markdown_view.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_oss_local.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_powershell_exit_codes.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_qa_attach_secrets.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_qa_long_task.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_qa_print_output.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_qa_reuse_unrelated.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_qa_yolo_outside.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_repl.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_reuse_honesty.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_search.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_textsafe.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_tools_fs.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_transcript_ui.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_update_check.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v111_user_reports.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v113_fix_path.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v11_byo.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v11_speed.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v11_tool_fixes.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v130_cut_writes.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v130_reliability.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v140_parity.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v152_migration.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v153_user_errors.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v155_user_errors.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v156_autoupdate.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v156_paste_and_edits.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v157_zero_errors.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v15_hosted_models.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v15_reuse_off_subagent_hooks.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v160_stop_scope_atomic.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v161_residual_errors.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v170_v2.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v2_rules_skills_hooks.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v2_tokens_shortcuts.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v2_usage_headers.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v31_security.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v3_accounts_value_setup.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v3_activity.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v3_attachments.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v3_context.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v3_live_repl.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v3_single_login.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v4.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.1}/tests/test_v5.py +0 -0
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.8.1 (2026-11-14)
|
|
4
|
+
|
|
5
|
+
- **Gets help sooner when it is quietly stuck.** When the same test keeps failing the same way after a fix
|
|
6
|
+
attempt, or several steps change nothing while a check is red, Euron Code now tells Euron, so a stronger
|
|
7
|
+
helper model can step in. Before, only failed edits and empty answers counted, so a task could spin on a red
|
|
8
|
+
test for a long time.
|
|
9
|
+
- **"Verified" means the project's own checks passed.** In a project with its own tests or build, only those
|
|
10
|
+
(or a command you named in your request) count as verification after the last change. A helper script that
|
|
11
|
+
exits cleanly no longer marks a task "completed and verified" while a test still fails; Euron Code goes back
|
|
12
|
+
to the failing test instead.
|
|
13
|
+
|
|
14
|
+
## 1.8.0 (2026-11-14)
|
|
15
|
+
|
|
16
|
+
Finishes tasks faster, looks things up on the web, and stops asking what you already allowed.
|
|
17
|
+
|
|
18
|
+
- **Gets unstuck faster.** When a task keeps failing on the Euron model (failed edits, empty answers, a check that
|
|
19
|
+
still fails after a fix, or several minutes without progress), Euron may let a stronger helper model take a few
|
|
20
|
+
steps. Euron Code then hands the task back with a short note of where things stand (files changed, the last
|
|
21
|
+
check, what is left), so the Euron model carries on without redoing work. A task that is clearly too hard is
|
|
22
|
+
finished by the helper. You do not need to do anything; Euron Code says when it happens.
|
|
23
|
+
- **Web search.** A new `web_search` tool looks up what is not in your project and may be newer than the model
|
|
24
|
+
knows: the latest version of a package, breaking API changes, an error message, how a library works now. It
|
|
25
|
+
answers in a few lines with numbered sources, and the model can open a source with `web_fetch`. Your project
|
|
26
|
+
path, home folder and anything that looks like a secret are masked before a query leaves your computer. Turn it
|
|
27
|
+
off with `"webSearch": false` or a `"deny": ["WebSearch"]` rule.
|
|
28
|
+
- **Never asks the same thing twice.** Answers to permission questions are remembered for the project (in
|
|
29
|
+
`~/.euron`, never in the repo) and carry over to new sessions, `continue`, `--resume` and sub-agents:
|
|
30
|
+
- commands: this exact command, or every `npm test` / `pytest` command, in this project or in every project;
|
|
31
|
+
- edits: auto-approve edits inside this project (or every project);
|
|
32
|
+
- websites: this site, in this project or everywhere.
|
|
33
|
+
Destructive commands, files outside the project, secret files and Euron Code's own settings still ask, but only
|
|
34
|
+
once per exact thing (a yes is remembered) unless you choose "ask every time".
|
|
35
|
+
- **`/permissions`** lists everything that is allowed and where it is saved; `/permissions revoke <n>` takes one
|
|
36
|
+
back, `/permissions reset` forgets this project's answers, `/permissions auto-edits on|off` and
|
|
37
|
+
`/permissions ask-every-time on|off` set the switches.
|
|
38
|
+
- **Safer rules.** A broad rule (`Edit`, `Read`, `Bash(cat:*)`) no longer covers Euron Code's own settings, a
|
|
39
|
+
secret-looking file or a command that names files outside the project; only a rule for that exact thing does.
|
|
40
|
+
- **Fewer wasted steps.** Several web searches or page fetches in one step run at the same time, and a change
|
|
41
|
+
that only touches plain CSS or images is not sent back for a build check.
|
|
42
|
+
|
|
3
43
|
## 1.7.2 (2026-11-13)
|
|
4
44
|
|
|
5
45
|
- Task status reports from one-shot `euron -p` runs now reach Euron. They were sent on a connection the run had
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: euron-code
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.1
|
|
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>
|
|
@@ -449,13 +449,21 @@ Optional extras: `pip install "euron-code[images]"` (image resizing, clipboard),
|
|
|
449
449
|
|
|
450
450
|
### Answering permission questions
|
|
451
451
|
|
|
452
|
+
Your answers are remembered for the project (saved in `~/.euron`, never in the repo), so Euron Code does not
|
|
453
|
+
ask the same thing again: not in a new session, not after `continue` or `--resume`, not in a sub-agent.
|
|
454
|
+
|
|
452
455
|
| Key | Meaning |
|
|
453
456
|
|---|---|
|
|
454
|
-
| `y` | yes,
|
|
457
|
+
| `y` | yes, this time |
|
|
455
458
|
| `n` | no (you can then tell it what to do instead) |
|
|
456
|
-
| `a` | always
|
|
457
|
-
| `p` | always
|
|
458
|
-
| `
|
|
459
|
+
| `a` | always for this project: this exact command, all edits inside the project, or this website |
|
|
460
|
+
| `p` | always for this project: every command that starts the same way (e.g. every `npm test ...`) |
|
|
461
|
+
| `u` | always, in every project (a command prefix, auto-approve edits, a website) |
|
|
462
|
+
|
|
463
|
+
Some questions stay: a destructive command, a file outside the project, a secret-looking file (`.env`, keys) and
|
|
464
|
+
Euron Code's own settings (`EURON.md`, `.euron/`). Each exact one is asked once per project (`y` remembers it,
|
|
465
|
+
`o` allows it only this time), or every time after `/permissions ask-every-time on`. `/permissions` lists what is
|
|
466
|
+
allowed and where it is saved; `/permissions revoke <n>` takes one back; `/permissions reset` forgets them all.
|
|
459
467
|
|
|
460
468
|
### All commands
|
|
461
469
|
|
|
@@ -477,7 +485,7 @@ Optional extras: `pip install "euron-code[images]"` (image resizing, clipboard),
|
|
|
477
485
|
| `/review [focus]`, `/plan` | review uncommitted changes; plan mode |
|
|
478
486
|
| `/security`, `/security-review` | rescan the project and list open findings; let the AI fix them |
|
|
479
487
|
| `/knowledge` | rebuild the code map and show what goes into the context |
|
|
480
|
-
| `/permissions` |
|
|
488
|
+
| `/permissions` | what is allowed and where it is saved; `revoke <n>`, `reset`, `auto-edits on\|off`, `ask-every-time on\|off`, `mode acceptEdits`, `allow "Bash(pytest:*)"` |
|
|
481
489
|
| `/config` | show settings; `/config set <key> <value> [--project]` |
|
|
482
490
|
| `/thinking show\|collapse\|hide`, `/todos`, `/doctor` | reasoning display, task list, setup check |
|
|
483
491
|
| `/login`, `/logout`, `/bug`, `/release-notes`, `/exit` | |
|
|
@@ -795,6 +803,10 @@ and the keychain.
|
|
|
795
803
|
- Your key is never printed in full and never logged. Keys for your own model are sent only to that
|
|
796
804
|
provider, never to Euron.
|
|
797
805
|
- Edits and commands ask first. Files outside the project folder always ask, even to read.
|
|
806
|
+
- `web_search` sends only the search question (your project path, home folder and anything that looks like a
|
|
807
|
+
secret are masked) to Euron's research service.
|
|
808
|
+
- When a task is stuck on the Euron model, a stronger helper model run for Euron may answer a few of its steps;
|
|
809
|
+
it sees the same conversation the Euron model sees, and the task then goes back to the Euron model.
|
|
798
810
|
- Hooks are commands you configure; project hooks only run after you trust them.
|
|
799
811
|
- Text inside your files, web pages and command output is treated as data, not instructions.
|
|
800
812
|
|
|
@@ -383,13 +383,21 @@ Optional extras: `pip install "euron-code[images]"` (image resizing, clipboard),
|
|
|
383
383
|
|
|
384
384
|
### Answering permission questions
|
|
385
385
|
|
|
386
|
+
Your answers are remembered for the project (saved in `~/.euron`, never in the repo), so Euron Code does not
|
|
387
|
+
ask the same thing again: not in a new session, not after `continue` or `--resume`, not in a sub-agent.
|
|
388
|
+
|
|
386
389
|
| Key | Meaning |
|
|
387
390
|
|---|---|
|
|
388
|
-
| `y` | yes,
|
|
391
|
+
| `y` | yes, this time |
|
|
389
392
|
| `n` | no (you can then tell it what to do instead) |
|
|
390
|
-
| `a` | always
|
|
391
|
-
| `p` | always
|
|
392
|
-
| `
|
|
393
|
+
| `a` | always for this project: this exact command, all edits inside the project, or this website |
|
|
394
|
+
| `p` | always for this project: every command that starts the same way (e.g. every `npm test ...`) |
|
|
395
|
+
| `u` | always, in every project (a command prefix, auto-approve edits, a website) |
|
|
396
|
+
|
|
397
|
+
Some questions stay: a destructive command, a file outside the project, a secret-looking file (`.env`, keys) and
|
|
398
|
+
Euron Code's own settings (`EURON.md`, `.euron/`). Each exact one is asked once per project (`y` remembers it,
|
|
399
|
+
`o` allows it only this time), or every time after `/permissions ask-every-time on`. `/permissions` lists what is
|
|
400
|
+
allowed and where it is saved; `/permissions revoke <n>` takes one back; `/permissions reset` forgets them all.
|
|
393
401
|
|
|
394
402
|
### All commands
|
|
395
403
|
|
|
@@ -411,7 +419,7 @@ Optional extras: `pip install "euron-code[images]"` (image resizing, clipboard),
|
|
|
411
419
|
| `/review [focus]`, `/plan` | review uncommitted changes; plan mode |
|
|
412
420
|
| `/security`, `/security-review` | rescan the project and list open findings; let the AI fix them |
|
|
413
421
|
| `/knowledge` | rebuild the code map and show what goes into the context |
|
|
414
|
-
| `/permissions` |
|
|
422
|
+
| `/permissions` | what is allowed and where it is saved; `revoke <n>`, `reset`, `auto-edits on\|off`, `ask-every-time on\|off`, `mode acceptEdits`, `allow "Bash(pytest:*)"` |
|
|
415
423
|
| `/config` | show settings; `/config set <key> <value> [--project]` |
|
|
416
424
|
| `/thinking show\|collapse\|hide`, `/todos`, `/doctor` | reasoning display, task list, setup check |
|
|
417
425
|
| `/login`, `/logout`, `/bug`, `/release-notes`, `/exit` | |
|
|
@@ -729,6 +737,10 @@ and the keychain.
|
|
|
729
737
|
- Your key is never printed in full and never logged. Keys for your own model are sent only to that
|
|
730
738
|
provider, never to Euron.
|
|
731
739
|
- Edits and commands ask first. Files outside the project folder always ask, even to read.
|
|
740
|
+
- `web_search` sends only the search question (your project path, home folder and anything that looks like a
|
|
741
|
+
secret are masked) to Euron's research service.
|
|
742
|
+
- When a task is stuck on the Euron model, a stronger helper model run for Euron may answer a few of its steps;
|
|
743
|
+
it sees the same conversation the Euron model sees, and the task then goes back to the Euron model.
|
|
732
744
|
- Hooks are commands you configure; project hooks only run after you trust them.
|
|
733
745
|
- Text inside your files, web pages and command output is treated as data, not instructions.
|
|
734
746
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "euron-code"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.8.1"
|
|
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"
|
|
@@ -46,7 +46,7 @@ MAX_TOOLS_PER_REQUEST = 128 # servers refuse more tool definitions than this in
|
|
|
46
46
|
#: tools that are never dropped when the list has to be cut to MAX_TOOLS_PER_REQUEST
|
|
47
47
|
CORE_TOOLS = ("read_file", "write_file", "edit_file", "multi_edit", "list_dir", "glob", "grep", "bash", "todo_write",
|
|
48
48
|
"task", "skill", "read_document", "find_symbol", "delete_file", "move_file", "start_background_process",
|
|
49
|
-
"read_process_output", "stop_process", "check_app", "web_fetch", "db_query", "port_page",
|
|
49
|
+
"read_process_output", "stop_process", "check_app", "web_fetch", "web_search", "db_query", "port_page",
|
|
50
50
|
"create_mvc5_project")
|
|
51
51
|
SESSION_IN_USE_WAIT = 3 # a 409 right after a restart is usually this computer's own previous session
|
|
52
52
|
FIT_TARGET = 0.8 # never send a prompt above 80% of the window (estimate); shrink the history first
|
|
@@ -101,6 +101,8 @@ DEFAULT_STEP_BUDGET = 60
|
|
|
101
101
|
MAX_MIGRATION_NUDGES = 2 # "these legacy files are not carried over yet" asks per request
|
|
102
102
|
HANDOVERS_PER_STEP = 2 # legacy pages pasted into one step's results (8 at once overflowed the 32k context)
|
|
103
103
|
_EXIT_RE = re.compile(r"^Exit code: (-?\d+)")
|
|
104
|
+
#: changes with nothing to build or test: plain CSS, images, icons (1.8.0, no verify round trip for them)
|
|
105
|
+
_NO_BUILD_RE = re.compile(r"\.(css|svg|png|jpe?g|gif|webp|ico)$", re.I)
|
|
104
106
|
_DOC_RE = re.compile(r"(\.(md|txt|rst|adoc)$|^(LICENSE|NOTICE|THIRD_PARTY_NOTICES)|(^|/)\.euron/)", re.I)
|
|
105
107
|
_SOURCE_RE = re.compile(r"\.(py|ipynb|js|jsx|ts|tsx|mjs|cjs|vue|svelte|html|css|scss|java|kt|go|rs|c|cc|cpp|h|cs|"
|
|
106
108
|
r"php|rb|swift|dart|sql)$", re.I)
|
|
@@ -152,6 +154,16 @@ class _WaitClock:
|
|
|
152
154
|
|
|
153
155
|
WAIT_CLOCK = _WaitClock()
|
|
154
156
|
|
|
157
|
+
#: titles of the asks no broad rule covers (permissions.Permissions.hard_kind)
|
|
158
|
+
HARD_TITLES = {
|
|
159
|
+
"destructive": "Run this DESTRUCTIVE command?",
|
|
160
|
+
"outside_command": "Run this command? It names files outside the project.",
|
|
161
|
+
"private_host": "Fetch from a private / local network address?",
|
|
162
|
+
"own_settings": "Change Euron Code's own instructions or settings for this project?",
|
|
163
|
+
"secret": "Read a secret-looking file (keys, .env)?",
|
|
164
|
+
"outside": "Allow access outside the project?",
|
|
165
|
+
}
|
|
166
|
+
|
|
155
167
|
|
|
156
168
|
def hook_block(event: str, text: str) -> str:
|
|
157
169
|
return f'<hook-output event="{event}">\n{text.strip()}\n</hook-output>'
|
|
@@ -327,6 +339,19 @@ class Agent:
|
|
|
327
339
|
self._extensions = 0 # extra budget windows given to a request still making progress
|
|
328
340
|
self._ext_from = (0, 0.0) # (steps, active seconds) when the current budget window started
|
|
329
341
|
self._budget_kind = "step_budget"
|
|
342
|
+
# 1.8.0 rescue: model seconds since this request last made progress (a check passed, a todo was finished, a
|
|
343
|
+
# new file was changed), sent as X-Euron-Stall-Sec; and the steps a stronger helper model answered
|
|
344
|
+
self._stall_s = 0.0
|
|
345
|
+
self._stall_files: set = set()
|
|
346
|
+
self._stall_done = 0
|
|
347
|
+
self._rescue_steps = 0
|
|
348
|
+
self._handback_due = False
|
|
349
|
+
# 1.8.1: model-shaped failures the gateway cannot see in the messages (X-Euron-Signal): the same check red
|
|
350
|
+
# again after a fix attempt, and steps that change nothing while the last check is red
|
|
351
|
+
self._signal: Optional[str] = None
|
|
352
|
+
self._last_red: Dict[str, Tuple[str, int]] = {}
|
|
353
|
+
self._nodiff_red = 0
|
|
354
|
+
self._has_suite: Optional[bool] = None
|
|
330
355
|
self.last_status: Optional[Dict[str, Any]] = None # the last task's decided status + evidence
|
|
331
356
|
self._job_diff = ""
|
|
332
357
|
self._adopt_fails = 0
|
|
@@ -557,6 +582,12 @@ class Agent:
|
|
|
557
582
|
self._extensions = 0
|
|
558
583
|
self._ext_from = (0, 0.0)
|
|
559
584
|
self._budget_kind = "step_budget"
|
|
585
|
+
self._stall_s = 0.0
|
|
586
|
+
self._stall_files = set()
|
|
587
|
+
self._signal = None
|
|
588
|
+
self._last_red = {}
|
|
589
|
+
self._nodiff_red = 0
|
|
590
|
+
self._stall_done = sum(1 for t in self.ctx.todos if isinstance(t, dict) and t.get("status") == "completed")
|
|
560
591
|
self._done_at_window = sum(1 for t in self.ctx.todos if isinstance(t, dict) and t.get("status") == "completed")
|
|
561
592
|
self._job_diff = (resume_cp or {}).get("diff") or ""
|
|
562
593
|
self.client.mode = self.mode
|
|
@@ -642,7 +673,8 @@ class Agent:
|
|
|
642
673
|
return [c for c in self._checks if last_edit is None or c[0] >= last_edit]
|
|
643
674
|
|
|
644
675
|
def _evidence(self, result: Optional[TurnResult]) -> Dict[str, Any]:
|
|
645
|
-
|
|
676
|
+
own = [c for c in self._checks if self._verifying(c[1])] # 1.8.1: the project's own checks decide
|
|
677
|
+
last = own[-1] if own else (self._checks[-1] if self._checks else None)
|
|
646
678
|
return {"stop_reason": result.stop_reason if result else "error", "error": result.error if result else None,
|
|
647
679
|
"edits": bool(self._real_edits()), "verified": bool(self._real_edits()) and self._verified(),
|
|
648
680
|
"last_check": (last[1], last[2], last[3]) if last else None,
|
|
@@ -705,6 +737,7 @@ class Agent:
|
|
|
705
737
|
self._budget_used = (result.turns if result else 0, max(0.0, time.monotonic() - self._turn_started
|
|
706
738
|
- (WAIT_CLOCK.total - self._turn_waited)))
|
|
707
739
|
after = self._checks_after_edit() if self._real_edits() else self._checks
|
|
740
|
+
after = [c for c in after if self._verifying(c[1])] or after
|
|
708
741
|
last = after[-1] if after else None
|
|
709
742
|
verification = {"command": taskstate.clean_command(last[1], self.root) if last else "",
|
|
710
743
|
"exitCode": last[2] if last else None, "kind": taskstate.check_kind(last[1]) if last else "none"}
|
|
@@ -1454,6 +1487,10 @@ class Agent:
|
|
|
1454
1487
|
# last line of defence: the estimate must be under 80% of the window before anything is sent,
|
|
1455
1488
|
# so "context length exceeded" never reaches the user
|
|
1456
1489
|
self.fit_to_window()
|
|
1490
|
+
self._maybe_handback()
|
|
1491
|
+
if hasattr(self.llm, "stall_sec") and getattr(self.llm, "is_euron", False):
|
|
1492
|
+
self.llm.stall_sec = int(self._stall_s)
|
|
1493
|
+
self.llm.signal, self._signal = self._signal, None
|
|
1457
1494
|
payload = self._payload()
|
|
1458
1495
|
if not self.is_subagent:
|
|
1459
1496
|
self.ctxstats.observe(self.messages[1:])
|
|
@@ -1462,12 +1499,15 @@ class Agent:
|
|
|
1462
1499
|
act = self.activity
|
|
1463
1500
|
if act is not None:
|
|
1464
1501
|
act.request_started(self.tokens.prompt_estimate(self.messages, self.tool_schemas))
|
|
1502
|
+
t_model = time.monotonic()
|
|
1465
1503
|
try:
|
|
1466
1504
|
resp = self._stream_once(payload)
|
|
1467
1505
|
except BaseException:
|
|
1468
1506
|
if act is not None:
|
|
1469
1507
|
act.request_finished(None)
|
|
1470
1508
|
raise
|
|
1509
|
+
self._stall_s += time.monotonic() - t_model
|
|
1510
|
+
self._note_rescue()
|
|
1471
1511
|
if act is not None:
|
|
1472
1512
|
act.request_finished(resp.usage)
|
|
1473
1513
|
self.tokens.record(resp.usage, raw_est, euron=self.uses_euron)
|
|
@@ -1478,6 +1518,53 @@ class Agent:
|
|
|
1478
1518
|
return resp
|
|
1479
1519
|
return self._with_retries(call)
|
|
1480
1520
|
|
|
1521
|
+
# ---------------------------------------------------------- rescue hand-back (1.8.0)
|
|
1522
|
+
def _note_rescue(self) -> None:
|
|
1523
|
+
"""The gateway may answer a step of a struggling task with a stronger helper model (x-euron-tier 2/3) for a
|
|
1524
|
+
few calls; when that window ends, the next request carries a short state note so the Euron model continues
|
|
1525
|
+
from where the helper stopped instead of redoing work."""
|
|
1526
|
+
if not getattr(self.llm, "is_euron", False):
|
|
1527
|
+
return
|
|
1528
|
+
tier = str(getattr(self.llm, "last_tier", None) or "")
|
|
1529
|
+
kind = getattr(self.llm, "last_rescue", None)
|
|
1530
|
+
left = getattr(self.llm, "last_rescue_left", None)
|
|
1531
|
+
if tier in ("2", "3"):
|
|
1532
|
+
if self._rescue_steps == 0 and not self.is_subagent:
|
|
1533
|
+
self.ui.dim("(this task got stuck on the Euron model: a stronger helper model takes the next steps"
|
|
1534
|
+
+ (" and finishes it)" if kind == "finish" else ", then the Euron model continues)"))
|
|
1535
|
+
self._rescue_steps += 1
|
|
1536
|
+
self._stall_s = 0.0
|
|
1537
|
+
if kind != "finish" and left == 0:
|
|
1538
|
+
self._handback_due = True
|
|
1539
|
+
elif self._rescue_steps and tier == "1":
|
|
1540
|
+
self._handback_due = True # the window closed early (a cap, or the helper failed too)
|
|
1541
|
+
|
|
1542
|
+
def handback_note(self) -> str:
|
|
1543
|
+
edits = sorted({rel for _st, rel in self._real_edits()})
|
|
1544
|
+
todos = [t for t in self.ctx.todos if isinstance(t, dict)]
|
|
1545
|
+
done = sum(1 for t in todos if t.get("status") == "completed")
|
|
1546
|
+
nxt = next((str(t.get("content") or "")[:120] for t in todos if t.get("status") != "completed"), "")
|
|
1547
|
+
check = getattr(self, "_last_check", None)
|
|
1548
|
+
parts = [f"[Euron Code: a stronger helper model did the last {self._rescue_steps} step(s) of this task. "
|
|
1549
|
+
"The Euron model continues now: carry on from the current state, do not redo finished work."]
|
|
1550
|
+
if edits:
|
|
1551
|
+
parts.append("Files changed so far: " + ", ".join(edits[:15]) + ("..." if len(edits) > 15 else "") + ".")
|
|
1552
|
+
if check:
|
|
1553
|
+
parts.append(f"Last check: `{str(check[0])[:120]}` exited {check[1]}.")
|
|
1554
|
+
if todos:
|
|
1555
|
+
parts.append(f"Todos: {done} of {len(todos)} done" + (f"; next: {nxt}" if nxt else "") + ".")
|
|
1556
|
+
parts.append("Re-read a file before editing it.]")
|
|
1557
|
+
return " ".join(parts)
|
|
1558
|
+
|
|
1559
|
+
def _maybe_handback(self) -> None:
|
|
1560
|
+
if not self._handback_due or len(self.messages) < 2:
|
|
1561
|
+
return
|
|
1562
|
+
if self.messages[-1].get("role") not in ("tool", "user"):
|
|
1563
|
+
return
|
|
1564
|
+
self._handback_due = False
|
|
1565
|
+
self._append({"role": "user", "content": self.handback_note()})
|
|
1566
|
+
self._rescue_steps = 0
|
|
1567
|
+
|
|
1481
1568
|
def _stream_once(self, payload: Dict[str, Any]) -> Response:
|
|
1482
1569
|
r = Response()
|
|
1483
1570
|
calls: Dict[int, Dict[str, Any]] = {}
|
|
@@ -1619,6 +1706,7 @@ class Agent:
|
|
|
1619
1706
|
"""Run one step's tool calls. Edits in one step are all-or-nothing (1.6.0): when one of several edits
|
|
1620
1707
|
fails, the others of that step are undone, so no file (or pair of files) is left half-changed."""
|
|
1621
1708
|
edits = [tc for tc in tool_calls if (tc.get("function") or {}).get("name") in EDIT_TOOLS]
|
|
1709
|
+
edits_before = len(self._real_edits())
|
|
1622
1710
|
self._step_journal = {} if len(edits) >= 2 else None
|
|
1623
1711
|
self._step_failed_ids = set()
|
|
1624
1712
|
out: List[Dict[str, Any]] = []
|
|
@@ -1633,6 +1721,7 @@ class Agent:
|
|
|
1633
1721
|
self._settle_step(out, journal)
|
|
1634
1722
|
for m in out:
|
|
1635
1723
|
self._append(m)
|
|
1724
|
+
self._note_step_diff(edits_before)
|
|
1636
1725
|
if self.settings.get("supersedeStaleReads") == "always":
|
|
1637
1726
|
self._supersede_stale_reads()
|
|
1638
1727
|
return stop
|
|
@@ -1751,6 +1840,7 @@ class Agent:
|
|
|
1751
1840
|
parallel = (len(task_ids) > 1 and not self.is_subagent
|
|
1752
1841
|
and self.settings.get("parallelSubagents", True) is not False)
|
|
1753
1842
|
done: Dict[str, Tuple[str, Optional[str]]] = {}
|
|
1843
|
+
self._prefetch_network(tool_calls)
|
|
1754
1844
|
for i, tc in enumerate(tool_calls):
|
|
1755
1845
|
if stop is not None:
|
|
1756
1846
|
self._append({"role": "tool", "tool_call_id": tc["id"], "name": tc["function"]["name"],
|
|
@@ -1789,6 +1879,39 @@ class Agent:
|
|
|
1789
1879
|
stop = "stuck"
|
|
1790
1880
|
return stop
|
|
1791
1881
|
|
|
1882
|
+
def _prefetch_network(self, tool_calls: List[Dict[str, Any]]) -> None:
|
|
1883
|
+
"""Several web_search / web_fetch calls in one step (1.8.0): fetch them at the same time, then run the step
|
|
1884
|
+
as usual (each call finds its result ready). Only calls already allowed without asking are fetched early;
|
|
1885
|
+
nothing is shown or recorded out of order."""
|
|
1886
|
+
calls = []
|
|
1887
|
+
for tc in tool_calls:
|
|
1888
|
+
fn = tc.get("function") or {}
|
|
1889
|
+
tool = self.tool_map.get(fn.get("name") or "")
|
|
1890
|
+
if tool is None or not hasattr(tool, "prefetch"):
|
|
1891
|
+
continue
|
|
1892
|
+
try:
|
|
1893
|
+
args = json.loads(fn.get("arguments") or "{}")
|
|
1894
|
+
if not isinstance(args, dict):
|
|
1895
|
+
continue
|
|
1896
|
+
req = tool.permission(args, self.ctx)
|
|
1897
|
+
if self.permissions.check(req) != "allow":
|
|
1898
|
+
continue
|
|
1899
|
+
except Exception:
|
|
1900
|
+
continue
|
|
1901
|
+
calls.append((tool, args))
|
|
1902
|
+
if len(calls) < 2:
|
|
1903
|
+
return
|
|
1904
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
1905
|
+
|
|
1906
|
+
def one(item):
|
|
1907
|
+
tool, args = item
|
|
1908
|
+
try:
|
|
1909
|
+
tool.prefetch(args, self.ctx)
|
|
1910
|
+
except Exception:
|
|
1911
|
+
pass # the call runs normally later and reports its own error
|
|
1912
|
+
with ThreadPoolExecutor(max_workers=min(4, len(calls)), thread_name_prefix="euron-prefetch") as pool:
|
|
1913
|
+
list(pool.map(one, calls))
|
|
1914
|
+
|
|
1792
1915
|
def _run_parallel(self, calls: List[Dict[str, Any]], truncated: bool) -> Dict[str, Tuple[str, Optional[str]]]:
|
|
1793
1916
|
"""Several task calls in one step: run them at once (up to MAX_PARALLEL_SUBAGENTS). The gateway
|
|
1794
1917
|
allows a few requests per user in flight; a full queue is waited out by each sub-agent's retries."""
|
|
@@ -1941,9 +2064,23 @@ class Agent:
|
|
|
1941
2064
|
cls = failures.from_output(content, taskstate.check_kind(command) == "tests") if code else None
|
|
1942
2065
|
self._checks.append((self.steps, command or name, code, cls))
|
|
1943
2066
|
self._last_check_out = content if code else ""
|
|
2067
|
+
self._note_red(command or name, code, cls, content)
|
|
1944
2068
|
if not failed and req is not None and name not in ("todo_write",):
|
|
1945
2069
|
what = (req.command or "") if name == "bash" else ", ".join(self.ctx.rel(p) for p in req.paths[:3])
|
|
1946
2070
|
self._last_ok_action = f"step {self.steps}: {name} {what}".strip()[:200]
|
|
2071
|
+
# progress resets the stall clock (X-Euron-Stall-Sec): a passing check, a finished todo, a new file changed
|
|
2072
|
+
if is_check and not failed:
|
|
2073
|
+
self._stall_s = 0.0
|
|
2074
|
+
if name == "todo_write" and not failed:
|
|
2075
|
+
done_now = sum(1 for t in self.ctx.todos if isinstance(t, dict) and t.get("status") == "completed")
|
|
2076
|
+
if done_now > self._stall_done:
|
|
2077
|
+
self._stall_s = 0.0
|
|
2078
|
+
self._stall_done = done_now
|
|
2079
|
+
if not failed and req is not None and req.category == "Edit":
|
|
2080
|
+
fresh = {str(p) for p in req.paths} - self._stall_files
|
|
2081
|
+
if fresh:
|
|
2082
|
+
self._stall_files |= fresh
|
|
2083
|
+
self._stall_s = 0.0
|
|
1947
2084
|
v = self.guard.tool_result(name, content, is_check=is_check)
|
|
1948
2085
|
notes = [v.note] if v.note else []
|
|
1949
2086
|
if not failed and req is not None and req.category == "Edit" and name != "oss_adopt":
|
|
@@ -2073,17 +2210,19 @@ class Agent:
|
|
|
2073
2210
|
if (self.is_subagent or self._done_nudges >= self.policy.done_nudges or not self._real_edits()
|
|
2074
2211
|
or self.permissions.mode == "plan" or self.settings.get("verifyNudge", True) is False):
|
|
2075
2212
|
return None
|
|
2076
|
-
if all(_DOC_RE.search(rel) for rel in self.files_changed()):
|
|
2077
|
-
return None # docs / notes only: nothing to build
|
|
2213
|
+
if all(_DOC_RE.search(rel) or _NO_BUILD_RE.search(rel) for rel in self.files_changed()):
|
|
2214
|
+
return None # docs / notes / plain CSS / images only: nothing to build (1.8.0: no extra steps for these)
|
|
2078
2215
|
if self._verified():
|
|
2079
2216
|
return None
|
|
2080
2217
|
last_edit = self._last_edit_step()
|
|
2081
2218
|
if last_edit is None:
|
|
2082
2219
|
return None
|
|
2083
2220
|
after = [(c, code) for step, c, code in self.ledger["commands"] if step >= last_edit
|
|
2084
|
-
and
|
|
2221
|
+
and self._verifying(c)]
|
|
2085
2222
|
if after and after[-1][1] != 0 and self._last_check:
|
|
2086
2223
|
cmd, code, tail = self._last_check
|
|
2224
|
+
if cmd != after[-1][0]: # a helper ran after the red check: report the project's own check
|
|
2225
|
+
cmd, code, tail = after[-1][0], after[-1][1], ""
|
|
2087
2226
|
return prompts.CHECK_FAILED_NUDGE.format(cmd=cmd[:160], code=code, tail=tail[:900] or "(no output)") \
|
|
2088
2227
|
+ self._diagnosis()
|
|
2089
2228
|
if self._nudged:
|
|
@@ -2653,9 +2792,88 @@ class Agent:
|
|
|
2653
2792
|
# a real check (tests, build, running it) after the last change, and the latest one passed;
|
|
2654
2793
|
# 1.2.0 counted ANY exit 0, so `ls` after a broken build was "verified"
|
|
2655
2794
|
after = [code for step, c, code in self.ledger["commands"] if step >= last_edit
|
|
2656
|
-
and
|
|
2795
|
+
and self._verifying(c)]
|
|
2657
2796
|
return bool(after) and after[-1] == 0
|
|
2658
2797
|
|
|
2798
|
+
# ---------------------------------------------------------- 1.8.1: what counts as verification, red signals
|
|
2799
|
+
def _project_has_suite(self) -> bool:
|
|
2800
|
+
"""The project has its own tests / build / lint (then only those verify a change, not a script run)."""
|
|
2801
|
+
if self._has_suite is None:
|
|
2802
|
+
found = False
|
|
2803
|
+
try:
|
|
2804
|
+
pkg = self.root / "package.json"
|
|
2805
|
+
if pkg.is_file():
|
|
2806
|
+
scripts = (json.loads(pkg.read_text(encoding="utf-8", errors="replace") or "{}").get("scripts") or {})
|
|
2807
|
+
found = any(k in scripts for k in ("test", "build", "lint", "typecheck"))
|
|
2808
|
+
if not found:
|
|
2809
|
+
n = 0
|
|
2810
|
+
for p in self.root.rglob("*"):
|
|
2811
|
+
n += 1
|
|
2812
|
+
if n > 4000:
|
|
2813
|
+
break
|
|
2814
|
+
if any(part in ("node_modules", ".git", ".venv", "venv", "__pycache__") for part in p.parts):
|
|
2815
|
+
continue
|
|
2816
|
+
nm = p.name.lower()
|
|
2817
|
+
if p.is_file() and (re.match(r"test_.*\.py$|.*_test\.(py|go)$|.*\.(test|spec)\.[jt]sx?$", nm)
|
|
2818
|
+
or nm in ("pytest.ini", "tox.ini", "makefile", "cargo.toml", "go.mod",
|
|
2819
|
+
"pom.xml", "build.gradle")):
|
|
2820
|
+
found = True
|
|
2821
|
+
break
|
|
2822
|
+
except (OSError, ValueError):
|
|
2823
|
+
found = False
|
|
2824
|
+
self._has_suite = found
|
|
2825
|
+
return self._has_suite
|
|
2826
|
+
|
|
2827
|
+
def _verifying(self, command: str) -> bool:
|
|
2828
|
+
"""A command that verifies the change: the project's own tests / build / lint / type check, or the command
|
|
2829
|
+
the user named. A run of a helper script does not (1.8.0 reported "completed and verified" after
|
|
2830
|
+
`python find_hash.py` exited 0 while the project's test still failed). Without a test suite in the
|
|
2831
|
+
project, running the program the task changed still counts."""
|
|
2832
|
+
c = (command or "").strip()
|
|
2833
|
+
if not c or not progress.is_check_command(c):
|
|
2834
|
+
return False
|
|
2835
|
+
segs = [s.strip() for s in re.split(r"\s*(?:&&|;|\|\|)\s*", c) if s.strip()]
|
|
2836
|
+
asked = (self._objective or "").lower()
|
|
2837
|
+
for s in segs:
|
|
2838
|
+
if len(s) >= 4 and s.lower() in asked:
|
|
2839
|
+
return True # the user named this command
|
|
2840
|
+
if progress.is_suite_command(s):
|
|
2841
|
+
return True
|
|
2842
|
+
m = re.search(r"([\w.\\/-]+\.(?:py|js|mjs|cjs|ts|tsx|go))\b", s)
|
|
2843
|
+
if m and re.match(r"(test_.*|.*_test|.*\.(test|spec))\.\w+$", m.group(1).replace("\\", "/").split("/")[-1], re.I):
|
|
2844
|
+
return True # running one of the project's test files directly
|
|
2845
|
+
# A project with its own tests / build: only those verify. Without one, a passing check run (a scratch
|
|
2846
|
+
# script with asserts, running the program, a request to it) is the best evidence there is.
|
|
2847
|
+
return not self._project_has_suite()
|
|
2848
|
+
|
|
2849
|
+
def _note_red(self, command: str, code: int, cls: Optional[str], content: str) -> None:
|
|
2850
|
+
"""The same check red again, the same way, after the model tried a fix: a model-shaped failure."""
|
|
2851
|
+
key = re.sub(r"\s+", " ", (command or "").strip().lower())[:200]
|
|
2852
|
+
if code == 0:
|
|
2853
|
+
self._last_red.pop(key, None)
|
|
2854
|
+
self._nodiff_red = 0
|
|
2855
|
+
return
|
|
2856
|
+
if failures.blocks(cls) or cls in ("dependency_failure", "ssl_certificate", "environment_config",
|
|
2857
|
+
"permission_failure"):
|
|
2858
|
+
return # environment / setup: a stronger model does not fix it
|
|
2859
|
+
sig = progress.failure_signature(content)
|
|
2860
|
+
prev = self._last_red.get(key)
|
|
2861
|
+
edited_since = prev is not None and any(st > prev[1] for st, _ in self._real_edits())
|
|
2862
|
+
if prev is not None and prev[0] == sig and edited_since:
|
|
2863
|
+
self._signal = "compilation_failure" if cls == "compilation_failure" else "test_failure"
|
|
2864
|
+
self._last_red[key] = (sig, self.steps)
|
|
2865
|
+
|
|
2866
|
+
def _note_step_diff(self, edits_before: int) -> None:
|
|
2867
|
+
"""Steps that change no file while the last check is red: three in a row is a stuck loop."""
|
|
2868
|
+
red = bool(self._checks) and self._checks[-1][2] != 0
|
|
2869
|
+
if len(self._real_edits()) > edits_before or not red:
|
|
2870
|
+
self._nodiff_red = 0
|
|
2871
|
+
return
|
|
2872
|
+
self._nodiff_red += 1
|
|
2873
|
+
if self._nodiff_red >= 3:
|
|
2874
|
+
self._signal = self._signal or "stuck_loop"
|
|
2875
|
+
self._nodiff_red = 0
|
|
2876
|
+
|
|
2659
2877
|
def _infer_edit_path(self, args: Dict[str, Any]) -> Optional[str]:
|
|
2660
2878
|
"""edit_file / multi_edit without `path` (bench 2026-11-09: a whole step lost to "Missing required
|
|
2661
2879
|
parameter `path`"): when exactly ONE file this session read or wrote contains every old_string, it is
|
|
@@ -2971,29 +3189,17 @@ class Agent:
|
|
|
2971
3189
|
"Db": "Open this database outside the project?",
|
|
2972
3190
|
}
|
|
2973
3191
|
title = titles.get(req.category or "", f"Allow {tool.name}?")
|
|
2974
|
-
|
|
2975
|
-
if
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
options.append(("p", f"always `{command_prefix(req.command or '')}` commands (session)"))
|
|
2979
|
-
elif req.category != "DbWrite":
|
|
2980
|
-
options.append(("a", f"always allow {req.category} (session)"))
|
|
2981
|
-
if req.category not in ("DbWrite",):
|
|
2982
|
-
options.append(("s", "always, and remember for this project"))
|
|
3192
|
+
hard = self.permissions.hard_kind(req)
|
|
3193
|
+
if hard in ("destructive", "outside_command", "private_host", "own_settings", "secret", "outside"):
|
|
3194
|
+
title = HARD_TITLES.get(hard, title)
|
|
3195
|
+
options = self._ask_options(req, hard)
|
|
2983
3196
|
t0 = time.monotonic()
|
|
2984
3197
|
try:
|
|
2985
3198
|
choice = self.ui.ask_permission(title, detail, options)
|
|
2986
3199
|
finally:
|
|
2987
3200
|
WAIT_CLOCK.add(time.monotonic() - t0)
|
|
2988
|
-
if choice
|
|
2989
|
-
|
|
2990
|
-
if choice in ("a", "p", "s"):
|
|
2991
|
-
rule = self.permissions.session_rule_for(req, prefix=(choice == "p" or (choice == "s" and req.category == "Bash")))
|
|
2992
|
-
self.permissions.grant_session(rule)
|
|
2993
|
-
if choice == "s":
|
|
2994
|
-
from euron_code import config
|
|
2995
|
-
path = config.add_permission_rule(self.root, "allow", rule)
|
|
2996
|
-
self.ui.dim(f" saved allow rule {rule} to {path}")
|
|
3201
|
+
if choice in ("y", "o", "a", "p", "u", "e", "s"):
|
|
3202
|
+
self._remember_choice(req, hard, choice)
|
|
2997
3203
|
return "allow", None
|
|
2998
3204
|
feedback = ""
|
|
2999
3205
|
if getattr(self.ui, "interactive", False):
|
|
@@ -3004,6 +3210,69 @@ class Agent:
|
|
|
3004
3210
|
WAIT_CLOCK.add(time.monotonic() - t0)
|
|
3005
3211
|
return "deny", feedback or None
|
|
3006
3212
|
|
|
3213
|
+
def _ask_options(self, req: Request, hard: Optional[str]) -> List[tuple]:
|
|
3214
|
+
"""What the user may answer (1.8.0): a yes is remembered for this project unless they say otherwise, so
|
|
3215
|
+
Euron Code never asks the same thing twice. Hard asks remember only that exact thing."""
|
|
3216
|
+
from euron_code.permissions import command_prefix
|
|
3217
|
+
if hard in ("destructive", "outside_command", "private_host", "own_settings", "secret", "outside"):
|
|
3218
|
+
if self.permissions.ask_every_time:
|
|
3219
|
+
return [("y", "yes, this time"), ("n", "no")]
|
|
3220
|
+
return [("y", "yes (remember this exact one for this project)"), ("o", "yes, only this time"),
|
|
3221
|
+
("n", "no")]
|
|
3222
|
+
if req.category == "Bash":
|
|
3223
|
+
pre = command_prefix(req.command or "")
|
|
3224
|
+
return [("y", "yes, this time"), ("a", "always this exact command in this project"),
|
|
3225
|
+
("p", f"always `{pre}` commands in this project"), ("u", f"always `{pre}` commands, every project"),
|
|
3226
|
+
("n", "no")]
|
|
3227
|
+
if req.category == "Edit":
|
|
3228
|
+
return [("y", "yes, this change"), ("a", "auto-approve edits inside this project"),
|
|
3229
|
+
("u", "auto-approve edits in every project"), ("n", "no")]
|
|
3230
|
+
if req.category == "WebFetch":
|
|
3231
|
+
return [("y", "yes, this time"), ("a", f"always {req.domain} in this project"),
|
|
3232
|
+
("u", f"always {req.domain}, every project"), ("n", "no")]
|
|
3233
|
+
if req.category == "DbWrite":
|
|
3234
|
+
return [("y", "yes, this statement"), ("n", "no")]
|
|
3235
|
+
return [("y", "yes, this time"), ("a", f"always allow {req.category} in this project"), ("n", "no")]
|
|
3236
|
+
|
|
3237
|
+
def _remember_choice(self, req: Request, hard: Optional[str], choice: str) -> None:
|
|
3238
|
+
"""Save what the user allowed (~/.euron/projects/<hash>.json, outside the repo: never committed, and a repo
|
|
3239
|
+
cannot plant it), so new sessions, "continue", resume and sub-agents never ask again."""
|
|
3240
|
+
from euron_code import config
|
|
3241
|
+
perms = self.permissions
|
|
3242
|
+
try:
|
|
3243
|
+
if hard in ("destructive", "outside_command", "private_host", "own_settings", "secret", "outside"):
|
|
3244
|
+
if choice != "y" or perms.ask_every_time:
|
|
3245
|
+
return # "only this time"
|
|
3246
|
+
rule = perms.remember_rule_for(req)
|
|
3247
|
+
perms.grant(rule)
|
|
3248
|
+
config.add_permission_rule(self.root, "allow", rule)
|
|
3249
|
+
self.ui.dim(f" remembered for this project: {rule} (/permissions to see or revoke)")
|
|
3250
|
+
return
|
|
3251
|
+
if choice in ("y", "o"):
|
|
3252
|
+
return
|
|
3253
|
+
if req.category == "Edit" and choice in ("a", "u"):
|
|
3254
|
+
perms.mode = "acceptEdits" if perms.mode == "default" else perms.mode
|
|
3255
|
+
if choice == "u":
|
|
3256
|
+
config.set_user_permission_flag("autoApproveEdits", True)
|
|
3257
|
+
self.ui.dim(" edits inside a project are now auto-approved in every project (/permissions)")
|
|
3258
|
+
else:
|
|
3259
|
+
config.set_project_permission_flag(self.root, "autoApproveEdits", True)
|
|
3260
|
+
self.ui.dim(" edits inside this project are now auto-approved (/permissions to change)")
|
|
3261
|
+
return
|
|
3262
|
+
rule = perms.session_rule_for(req, prefix=(choice in ("p", "u") or (choice == "s" and req.category == "Bash")))
|
|
3263
|
+
if choice == "a" and req.category == "Bash":
|
|
3264
|
+
rule = perms.exact_rule_for(req)
|
|
3265
|
+
perms.grant(rule)
|
|
3266
|
+
if choice == "u":
|
|
3267
|
+
path = config.add_user_permission_rule("allow", rule)
|
|
3268
|
+
self.ui.dim(f" allowed in every project: {rule} ({path})")
|
|
3269
|
+
else:
|
|
3270
|
+
config.add_permission_rule(self.root, "allow", rule)
|
|
3271
|
+
self.ui.dim(f" remembered for this project: {rule} (/permissions to see or revoke)")
|
|
3272
|
+
except OSError as e: # a read-only home folder: the grant still holds for this session
|
|
3273
|
+
perms.grant_session(perms.session_rule_for(req))
|
|
3274
|
+
self.ui.dim(f" could not save the permission ({type(e).__name__}); it holds for this session")
|
|
3275
|
+
|
|
3007
3276
|
# ---------------------------------------------------------- compaction
|
|
3008
3277
|
def context_usage(self) -> int:
|
|
3009
3278
|
return self.tokens.prompt_estimate(self.messages, self.tool_schemas)
|