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

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle #1

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle #3

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

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 master Jul 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>
Sign up for free to 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