euron-code 1.7.0__tar.gz → 1.7.2__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.0 → euron_code-1.7.2}/CHANGELOG.md +14 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/PKG-INFO +1 -1
- {euron_code-1.7.0 → euron_code-1.7.2}/pyproject.toml +1 -1
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/__init__.py +1 -1
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/taskstate.py +88 -39
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/update_check.py +31 -1
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v170_v2.py +62 -3
- {euron_code-1.7.0 → euron_code-1.7.2}/.gitignore +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/LICENSE +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/README.md +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/__main__.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/activity.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/agent.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/api.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/attachments.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/auth.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/autoupdate.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/builtin_skills/build-from-reference/SKILL.md +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/builtin_skills/explain-codebase/SKILL.md +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/builtin_skills/review/SKILL.md +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/builtin_skills/test-writer/SKILL.md +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/cache.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/checkpoints.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/cli.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/codeindex.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/config.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/context.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/contextforge/LICENSE +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/contextforge/__init__.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/contextforge/text.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/contextforge/toolout.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/credentials.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/ctxstats.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/doctor.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/documents.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/dotnet.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/error_hints.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/errorlog.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/failures.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/friendly.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/frontmatter.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/hooks.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/keys.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/knowledge.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/licensing.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/llm/__init__.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/llm/anthropic.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/llm/base.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/llm/openai_compat.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/llm/setup.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/logo.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/markdown_view.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/memory.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/migration.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/modes.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/mvc5.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/osscache.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/ossgithub.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/pasteinput.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/pathfix.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/permissions.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/progress.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/project_setup.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/prompts.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/repl.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/repomap.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/rules.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/security_scan.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/sessions.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/skills.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/textsafe.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tls.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/__init__.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/background.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/base.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/db.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/document.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/erie.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/fs.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/ignore.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/normalize.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/oss.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/pathfind.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/port.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/reuse.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/search.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/shell.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/skill.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/symbols.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/task.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/todo.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/tools/web.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/transcript.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/trust.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/ui.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/usage_view.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/version_info.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/webforms.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/conftest.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/fake_providers.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/helpers.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/measure_floor.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/mock_gateway.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/serve_helper.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/sim_long_session.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_agent_mock.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_api_shell.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_bench.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_bench_harness.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_cli_e2e.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_context_memory_sessions.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_dashboard_fixes.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_dashboard_fixes_102.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_db.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_erie.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_knowledge_security.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_markdown_view.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_oss_local.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_permissions.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_powershell_exit_codes.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_qa_attach_secrets.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_qa_long_task.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_qa_print_output.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_qa_reuse_unrelated.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_qa_yolo_outside.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_repl.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_reuse_honesty.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_search.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_textsafe.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_tools_fs.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_transcript_ui.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_update_check.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v111_user_reports.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v113_fix_path.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v11_byo.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v11_speed.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v11_tool_fixes.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v130_cut_writes.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v130_reliability.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v140_parity.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v152_migration.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v153_user_errors.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v155_user_errors.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v156_autoupdate.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v156_paste_and_edits.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v157_zero_errors.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v15_hosted_models.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v15_reuse_off_subagent_hooks.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v160_stop_scope_atomic.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v161_residual_errors.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v2_rules_skills_hooks.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v2_tokens_shortcuts.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v2_usage_headers.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v31_security.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v3_accounts_value_setup.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v3_activity.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v3_attachments.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v3_context.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v3_live_repl.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v3_single_login.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v4.py +0 -0
- {euron_code-1.7.0 → euron_code-1.7.2}/tests/test_v5.py +0 -0
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.2 (2026-11-13)
|
|
4
|
+
|
|
5
|
+
- Task status reports from one-shot `euron -p` runs now reach Euron. They were sent on a connection the run had
|
|
6
|
+
already closed, so they stayed queued; a waiting backlog is now sent newest first, and each report leaves the
|
|
7
|
+
queue as soon as it is received.
|
|
8
|
+
|
|
9
|
+
## 1.7.1 (2026-11-13)
|
|
10
|
+
|
|
11
|
+
- Self-update finds a new release as soon as it is out. PyPI's version page can lag for some minutes after a
|
|
12
|
+
release, so an older Euron Code could miss it (and, when its version was too old for Euron's servers, not find
|
|
13
|
+
the version to update to). It now also asks the package index that `pip` uses, and takes the newest.
|
|
14
|
+
- Task status reports are kept until Euron has them. In 1.7.0 a report could be lost when a one-shot `euron -p`
|
|
15
|
+
run ended straight away; now each report is saved first and leaves the queue only once it was received.
|
|
16
|
+
|
|
3
17
|
## 1.7.0 (2026-11-13)
|
|
4
18
|
|
|
5
19
|
Finishes more work per request on the Euron model, says honestly how far a task got, and picks up where it
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: euron-code
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.2
|
|
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>
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "euron-code"
|
|
7
|
-
version = "1.7.
|
|
7
|
+
version = "1.7.2"
|
|
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"
|
|
@@ -309,64 +309,113 @@ def _queue_path() -> Path:
|
|
|
309
309
|
return config.euron_home() / OUTCOME_QUEUE
|
|
310
310
|
|
|
311
311
|
|
|
312
|
-
def
|
|
313
|
-
try:
|
|
314
|
-
p = _queue_path()
|
|
315
|
-
old = []
|
|
316
|
-
if p.is_file():
|
|
317
|
-
old = [json.loads(ln) for ln in p.read_text(encoding="utf-8").splitlines() if ln.strip()]
|
|
318
|
-
allq = (old + items)[-MAX_OUTCOME_QUEUE:]
|
|
319
|
-
_write_private(p, "\n".join(json.dumps(x, ensure_ascii=False) for x in allq) + ("\n" if allq else ""))
|
|
320
|
-
except (OSError, ValueError):
|
|
321
|
-
pass
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
def _take_queue(n: int = 20) -> List[Dict[str, Any]]:
|
|
312
|
+
def _read_queue() -> List[Dict[str, Any]]:
|
|
325
313
|
try:
|
|
326
314
|
p = _queue_path()
|
|
327
315
|
if not p.is_file():
|
|
328
316
|
return []
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
317
|
+
out = []
|
|
318
|
+
for ln in p.read_text(encoding="utf-8").splitlines():
|
|
319
|
+
try:
|
|
320
|
+
if ln.strip():
|
|
321
|
+
out.append(json.loads(ln))
|
|
322
|
+
except ValueError:
|
|
323
|
+
continue
|
|
324
|
+
return out
|
|
325
|
+
except OSError:
|
|
333
326
|
return []
|
|
334
327
|
|
|
335
328
|
|
|
329
|
+
def _write_queue(items: List[Dict[str, Any]]) -> None:
|
|
330
|
+
try:
|
|
331
|
+
items = items[-MAX_OUTCOME_QUEUE:]
|
|
332
|
+
_write_private(_queue_path(), "\n".join(json.dumps(x, ensure_ascii=False) for x in items) + ("\n" if items else ""))
|
|
333
|
+
except OSError:
|
|
334
|
+
pass
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
def _ident(item: Dict[str, Any]) -> tuple:
|
|
338
|
+
return (item.get("taskId"), item.get("clientVersion"), item.get("status"))
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
_qlock = threading.Lock()
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
def _queue(items: List[Dict[str, Any]]) -> None:
|
|
345
|
+
"""Add outcomes to the durable queue (the same task again replaces its older entry)."""
|
|
346
|
+
with _qlock:
|
|
347
|
+
new_ids = {(x.get("taskId"), x.get("clientVersion")) for x in items}
|
|
348
|
+
old = [x for x in _read_queue() if (x.get("taskId"), x.get("clientVersion")) not in new_ids]
|
|
349
|
+
_write_queue(old + items)
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
def _drop(sent: set) -> None:
|
|
353
|
+
with _qlock:
|
|
354
|
+
_write_queue([x for x in _read_queue() if _ident(x) not in sent])
|
|
355
|
+
|
|
356
|
+
|
|
336
357
|
_last_send: Dict[str, Any] = {}
|
|
358
|
+
_threads: List[threading.Thread] = []
|
|
359
|
+
BATCH = 20
|
|
360
|
+
EXIT_WAIT_S = 2.5
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
def _flush(client) -> None:
|
|
364
|
+
"""Newest first, and each accepted report leaves the queue at once: a one-shot run that ends after
|
|
365
|
+
EXIT_WAIT_S still makes progress on a backlog (1.7.2: 1.7.1 removed only after the whole batch, about 0.5 s a
|
|
366
|
+
report, so a -p run with 5+ queued never drained it)."""
|
|
367
|
+
for item in list(reversed(_read_queue()))[:BATCH]:
|
|
368
|
+
try:
|
|
369
|
+
st = client.task_outcome(item)
|
|
370
|
+
except Exception:
|
|
371
|
+
st = None
|
|
372
|
+
_last_send["status"] = st
|
|
373
|
+
if st in (404, 405):
|
|
374
|
+
break # an older gateway: everything stays queued for later
|
|
375
|
+
if st is None or st >= 500 or st == 429:
|
|
376
|
+
continue # stays queued
|
|
377
|
+
_drop({_ident(item)}) # 2xx, or a 400 that sending again cannot fix
|
|
337
378
|
|
|
338
379
|
|
|
339
380
|
def report(client, payload: Dict[str, Any], wait: float = 0.0) -> Optional[threading.Thread]:
|
|
340
|
-
"""
|
|
341
|
-
|
|
381
|
+
"""Queue one outcome durably, then send the queue (it and any earlier ones) in the background. An entry
|
|
382
|
+
leaves the queue only once the gateway took it, so an older gateway (404), being offline, or the process
|
|
383
|
+
ending mid-send loses nothing (1.7.1: 1.7.0 took entries off the queue before sending, and a `-p` run that
|
|
384
|
+
ended at once dropped them). Never raises; at exit it waits at most EXIT_WAIT_S for the send."""
|
|
342
385
|
if client is None or not getattr(client, "api_key", None) or not hasattr(client, "task_outcome"):
|
|
343
386
|
return None
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
if st in (404, 405):
|
|
355
|
-
failed.extend(batch[i:]) # an older gateway: keep everything for later
|
|
356
|
-
break
|
|
357
|
-
if st is None or st >= 500 or st == 429:
|
|
358
|
-
failed.append(item)
|
|
359
|
-
# 2xx sent; 400 invalid payload dropped (sending it again cannot help)
|
|
360
|
-
if failed:
|
|
361
|
-
_queue(failed)
|
|
362
|
-
|
|
363
|
-
t = threading.Thread(target=run, name="euron-outcome", daemon=True)
|
|
387
|
+
_queue([payload])
|
|
388
|
+
# its own connection: a `-p` run closes the main client right after the answer, while this still sends
|
|
389
|
+
# (1.7.2: every report from a one-shot run failed on the closed client and stayed queued)
|
|
390
|
+
sender = client
|
|
391
|
+
if hasattr(client, "clone"):
|
|
392
|
+
try:
|
|
393
|
+
sender = client.clone()
|
|
394
|
+
except Exception:
|
|
395
|
+
sender = client
|
|
396
|
+
t = threading.Thread(target=_flush, args=(sender,), name="euron-outcome", daemon=True)
|
|
364
397
|
t.start()
|
|
398
|
+
_threads.append(t)
|
|
365
399
|
if wait:
|
|
366
400
|
t.join(wait)
|
|
367
401
|
return t
|
|
368
402
|
|
|
369
403
|
|
|
404
|
+
def _wait_at_exit() -> None:
|
|
405
|
+
import time as _t
|
|
406
|
+
end = _t.monotonic() + EXIT_WAIT_S
|
|
407
|
+
for t in list(_threads):
|
|
408
|
+
left = end - _t.monotonic()
|
|
409
|
+
if left <= 0:
|
|
410
|
+
break
|
|
411
|
+
t.join(left)
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
import atexit # noqa: E402
|
|
415
|
+
|
|
416
|
+
atexit.register(_wait_at_exit)
|
|
417
|
+
|
|
418
|
+
|
|
370
419
|
def build_payload(*, task_id: str, job_id: str, session_id: Optional[str], decided: Dict[str, Any],
|
|
371
420
|
verification: Dict[str, Any], steps: int, files_changed: int, mode: str, resumed: bool,
|
|
372
421
|
budget: Dict[str, Any]) -> Dict[str, Any]:
|
|
@@ -17,6 +17,10 @@ from typing import Optional, Tuple
|
|
|
17
17
|
from euron_code import __version__, config
|
|
18
18
|
|
|
19
19
|
PYPI_URL = "https://pypi.org/pypi/euron-code/json"
|
|
20
|
+
# 1.7.1: the JSON API is served from a CDN whose nodes can lag the simple index by minutes (seen at the 1.7.0
|
|
21
|
+
# release: one request said 1.6.1 while pip already installed 1.7.0). A client refused as too old would then
|
|
22
|
+
# not find the version it must update to. The simple index (what pip itself uses) is asked too; newest wins.
|
|
23
|
+
SIMPLE_URL = "https://pypi.org/simple/euron-code/"
|
|
20
24
|
CHECK_EVERY_S = 6 * 3600 # 1.5.6: auto-update checks four times a day at most
|
|
21
25
|
TIMEOUT_S = 2.0
|
|
22
26
|
|
|
@@ -54,7 +58,7 @@ def _write_cache(data: dict) -> None:
|
|
|
54
58
|
pass
|
|
55
59
|
|
|
56
60
|
|
|
57
|
-
def
|
|
61
|
+
def _json_api_latest() -> Optional[str]:
|
|
58
62
|
try:
|
|
59
63
|
import httpx
|
|
60
64
|
r = httpx.get(PYPI_URL, timeout=TIMEOUT_S, headers={"Accept": "application/json"})
|
|
@@ -66,6 +70,32 @@ def _fetch_latest() -> Optional[str]:
|
|
|
66
70
|
return None
|
|
67
71
|
|
|
68
72
|
|
|
73
|
+
def _simple_index_latest() -> Optional[str]:
|
|
74
|
+
"""The newest final release in the PEP 691 JSON simple index (pre-releases and yanked files skipped)."""
|
|
75
|
+
try:
|
|
76
|
+
import httpx
|
|
77
|
+
r = httpx.get(SIMPLE_URL, timeout=TIMEOUT_S, headers={"Accept": "application/vnd.pypi.simple.v1+json"})
|
|
78
|
+
if r.status_code != 200:
|
|
79
|
+
return None
|
|
80
|
+
data = r.json()
|
|
81
|
+
live = {str(f.get("filename") or "").split("-")[1] for f in data.get("files") or []
|
|
82
|
+
if not f.get("yanked") and str(f.get("filename") or "").count("-") >= 1}
|
|
83
|
+
versions = [v for v in (data.get("versions") or []) if v in live or not live]
|
|
84
|
+
finals = [v for v in versions if _parse(v) and not re.search(r"[a-zA-Z]", v)]
|
|
85
|
+
return max(finals, key=_parse) if finals else None
|
|
86
|
+
except Exception:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def newest(*versions: Optional[str]) -> Optional[str]:
|
|
91
|
+
vs = [v for v in versions if v and _parse(v)]
|
|
92
|
+
return max(vs, key=_parse) if vs else None
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def _fetch_latest() -> Optional[str]:
|
|
96
|
+
return newest(_json_api_latest(), _simple_index_latest())
|
|
97
|
+
|
|
98
|
+
|
|
69
99
|
def latest_version(now: Optional[float] = None, fetch=_fetch_latest, fresh: bool = False) -> Optional[str]:
|
|
70
100
|
"""The newest version on PyPI, from the cache when it is less than CHECK_EVERY_S old."""
|
|
71
101
|
now = time.time() if now is None else now
|
|
@@ -324,8 +324,10 @@ def test_outcome_report_payload_and_offline_queue(project, monkeypatch):
|
|
|
324
324
|
budget={"steps": 5, "stepsLimit": 30, "activeSec": 40, "timeLimitSec": 900})
|
|
325
325
|
assert p["status"] == "completed_verified" and p["budget"]["limitHit"] is None
|
|
326
326
|
assert "sk-abcdefghijklmnop" not in p["verification"]["command"]
|
|
327
|
-
taskstate.report(C(), p)
|
|
328
|
-
assert
|
|
327
|
+
t = taskstate.report(C(), p)
|
|
328
|
+
assert taskstate._read_queue()[-1]["taskId"] == "t" * 32 # on disk before any send: a process exit loses nothing
|
|
329
|
+
t.join(5)
|
|
330
|
+
assert sent and len(taskstate._read_queue()) == 1 # 404: kept for later
|
|
329
331
|
# next time the gateway has it: the queue is sent too
|
|
330
332
|
sent.clear()
|
|
331
333
|
|
|
@@ -334,7 +336,7 @@ def test_outcome_report_payload_and_offline_queue(project, monkeypatch):
|
|
|
334
336
|
sent.append(payload)
|
|
335
337
|
return 200
|
|
336
338
|
taskstate.report(C2(), dict(p, taskId="u" * 32)).join(5)
|
|
337
|
-
assert len(sent) == 2 and not taskstate.
|
|
339
|
+
assert len(sent) == 2 and not taskstate._read_queue() # 200: the queued one went too, and left the queue
|
|
338
340
|
|
|
339
341
|
|
|
340
342
|
# ================================================================ diagnose: error locations
|
|
@@ -469,3 +471,60 @@ def test_doctor_has_the_install_checks(monkeypatch):
|
|
|
469
471
|
ctx = tls.verify_arg({"sslTrustStore": "system"})
|
|
470
472
|
import ssl
|
|
471
473
|
assert isinstance(ctx, ssl.SSLContext) and ctx.verify_mode == ssl.CERT_REQUIRED # never off
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
# ================================================================ 1.7.1: update check sees the newest of both PyPI views
|
|
477
|
+
|
|
478
|
+
def test_update_check_takes_the_newest_of_json_api_and_simple_index(monkeypatch):
|
|
479
|
+
from euron_code import update_check as u
|
|
480
|
+
monkeypatch.setattr(u, "_json_api_latest", lambda: "1.6.1") # a lagging CDN node
|
|
481
|
+
monkeypatch.setattr(u, "_simple_index_latest", lambda: "1.7.0")
|
|
482
|
+
assert u._fetch_latest() == "1.7.0"
|
|
483
|
+
monkeypatch.setattr(u, "_simple_index_latest", lambda: None) # offline / blocked: the JSON answer still counts
|
|
484
|
+
assert u._fetch_latest() == "1.6.1"
|
|
485
|
+
assert u.newest("1.10.0", "1.9.9", None) == "1.10.0"
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
def test_flush_sends_newest_first_and_drops_each_report_at_once(project):
|
|
489
|
+
"""1.7.2: a backlog drains even when the process ends part-way (each accepted report leaves at once)."""
|
|
490
|
+
taskstate._write_queue([{"taskId": f"{i:032x}", "clientVersion": "1.7.0", "status": "partial"} for i in range(5)])
|
|
491
|
+
calls = []
|
|
492
|
+
|
|
493
|
+
class Half:
|
|
494
|
+
api_key = "k"
|
|
495
|
+
|
|
496
|
+
def task_outcome(self, payload):
|
|
497
|
+
calls.append(payload["taskId"])
|
|
498
|
+
return 202 if len(calls) <= 2 else 503 # the process "ends" (server busy) after two
|
|
499
|
+
|
|
500
|
+
taskstate._flush(Half())
|
|
501
|
+
left = [x["taskId"] for x in taskstate._read_queue()]
|
|
502
|
+
assert calls[0] == f"{4:032x}" # newest first
|
|
503
|
+
assert left == [f"{i:032x}" for i in range(3)] # the two accepted ones are gone, the rest stay
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
def test_report_sends_on_its_own_connection(project, monkeypatch):
|
|
507
|
+
"""1.7.2: a -p run closes its client right after the answer; the report must not use that client."""
|
|
508
|
+
used = []
|
|
509
|
+
|
|
510
|
+
class Main:
|
|
511
|
+
api_key = "k"
|
|
512
|
+
closed = False
|
|
513
|
+
|
|
514
|
+
def clone(self):
|
|
515
|
+
return Clone()
|
|
516
|
+
|
|
517
|
+
def task_outcome(self, payload):
|
|
518
|
+
used.append("main")
|
|
519
|
+
return None if self.closed else 202
|
|
520
|
+
|
|
521
|
+
class Clone(Main):
|
|
522
|
+
def task_outcome(self, payload):
|
|
523
|
+
used.append("clone")
|
|
524
|
+
return 202
|
|
525
|
+
|
|
526
|
+
m = Main()
|
|
527
|
+
t = taskstate.report(m, {"taskId": "c" * 32, "clientVersion": "1.7.2", "status": "partial"})
|
|
528
|
+
m.closed = True
|
|
529
|
+
t.join(5)
|
|
530
|
+
assert used == ["clone"] and not taskstate._read_queue()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/builtin_skills/build-from-reference/SKILL.md
RENAMED
|
File without changes
|
{euron_code-1.7.0 → euron_code-1.7.2}/src/euron_code/builtin_skills/explain-codebase/SKILL.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|