Skip to content

emrg: improve tool error handling (glob + edit) - #1

Merged
argszero merged 1 commit into
masterfrom
feature/tool-error-handling
Jul 18, 2026
Merged

emrg: improve tool error handling (glob + edit)#1
argszero merged 1 commit into
masterfrom
feature/tool-error-handling

Conversation

@argszero

Copy link
Copy Markdown
Owner

Changes

glob_tool

  • Error on nonexistent workdir: previously silently fell back to Path.cwd() when workdir didn't exist, masking typos. Now returns explicit error.
  • Remove unused import os: cleanup.

edit_tool

  • OSError handling: path.write_text() now wrapped in try/except OSError to return clean error (disk full, permissions), consistent with write_tool.

- glob_tool: error on nonexistent workdir instead of silent CWD fallback
- glob_tool: remove unused import os
- edit_tool: add OSError handling for write_text, matching write_tool

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle #1

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle #3

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle #4

@argszero
argszero merged commit 96d0137 into masterJul 18, 2026
This was referenced Jul 18, 2026
argszero added a commit that referenced this pull request Jul 28, 2026
Remove 3 set_title call sites (tool_start, first-delta, streaming), unify idle states.
@argszero
argszero deleted the feature/tool-error-handling branch July 28, 2026 12:00
argszero added a commit that referenced this pull request Aug 6, 2026
…07-27) (#429)
对照 .emrg/memory/paper-prompt-remaining-gaps.md 的 5 项缺陷修复 4 项
(#1 记忆路径已由状态文件机制解决,无需改动):
1. **LaTeX 编译必然失败** → 编译前 which latexmk 检查,不可用则跳过编译
只做文本级交叉引用检查
2. **文献检索无去重** → 检索前先 ls literature/ 已有文献,笔记已存在则跳过
3. **arXiv 关键词与研究方向脱节** → 禁止通用大词 all:large+language+model,
改为从 Agent.md/摘要/状态文件派生方向术语构造靶向查询
4. **seq 重置误导** → 当前状态区注明 daemon 重启后序号重置,判断首次运行
以状态文件为准
新增 tests/test_scheduler.py 模板渲染回归测试(paper_prompt.md 可正常渲染
且含状态文件/latexmk/literature 指引)。
验证:pytest 473 绿(+1 新测试)
Co-authored-by: EMRG Evolution <emrg@argszero.dev>
argszero added a commit that referenced this pull request Aug 14, 2026
…795)
Rant 2026-08-14T22:13:57: promote_prompt.md §0 only read the state
file + project config — the promoter had zero knowledge of the actual
project source/latest progress, while open-source tasks (#790) must
study the full codebase. Asymmetric: same EMRG contributes after
deep code study but promotes from a one-line description → stale or
wrong answers to community questions (violating red lines #1/#7).
Changes:
- promote_prompt.md new §0.4 'Learn the project's latest state (MUST
every round)': git fetch + last 10 commits, read repo root, scan key
modules, refresh cognition; any capability claim must come from
just-verified latest state (mirrors open_source B.2b)
- §3 Step 2: Good-example note — feature descriptions must come from
§0.4-verified state, not stale memory/description guesses
- §4 state file: new 'last learned' field (time + commit HEAD) for
knowledge freshness
- §5 reflection Q3: must record what project info was learned this
round (commit range / modules read)
- +1 template render test (7 positive assertions); Agent.md 810->811
Co-authored-by: EMRG Evolution <emrg@argszero.dev>
argszero added a commit that referenced this pull request Aug 26, 2026
…ds/copywriting) + preload API-surface guard (#992)
Renderer migration Batch 1 (design doc v0.1 §5, rant 2026-08-26T12:16:48,
D1-D7 decided). Follows #991 (Batch 0) now merged.
- renderer/src/lib/commands.ts: vanilla renderer/js/commands.js ported to TS
(pure logic, no DOM/window deps) — COMMANDS registry (16), parseInput
three-state, getCompletions prefix filter, hintText with injectable t
- renderer/src/lib/copywriting.ts: vanilla renderer/js/copywriting.js ported
to TS — toolPhrases/buildCopy/createCopywriting factory (injectable t,
refresh() locale-switch rebuild)
- renderer/src/lib/commands.test.ts + copywriting.test.ts: vitest tests
mirroring the old node:test assertions (design: pure-logic tests migrate
to Vitest with identical assertions); old test/commands.test.js stays
until Batch 5 switch (D3/D6)
- emrg/gui/test/preload-api.test.js: window.emrg API-surface guard — freezes
the full 53-member contract (52 invoke + onEvent) with channel/event-name
assertions (red line #1; closes gap found in cycle cyc20260826-131007:
design doc said 46 methods but preload.js actually exposes 52 + onEvent,
only spot checks existed before)
- Agent.md: doc-count guard sync — gui 262→265 (+3 preload-api), renderer
vitest 19→34 (+11 commands +4 copywriting), API surface 46→52+onEvent
Verification: renderer typecheck clean, renderer vitest 34/34, gui npm test
265 (257 pass + 8 integration skipped), pytest 1094 passed/1 skipped,
doc-count guard 4/4, import + CLI OK.
Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@argszero