Skip to content

emrg: GUI hint when tool-call limit truncates a task (max tool rounds) - #523

Merged
argszero merged 1 commit into
masterfrom
feature/gui-maxrounds-hint
Aug 6, 2026
Merged

emrg: GUI hint when tool-call limit truncates a task (max tool rounds)#523
argszero merged 1 commit into
masterfrom
feature/gui-maxrounds-hint

Conversation

@argszero

@argszero argszero commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

Cross-project lesson applied (mem repo: an agent hit its tool-call cap mid-fix and returned broken code without flagging incompleteness — the user was surprised). The TUI already shows ⚠ <content> Try '继续' to resume. on max-tool-rounds truncation (client/app.py:442), but the GUI just rendered the terse daemon message with no guidance — the user gets a half-finished task and no hint that they can continue.

Changes

  • emrg/gui/renderer/js/chat.jshandleDone now detects the truncation frame (content containing exceeded + max|limit|round) and adds a localized system hint: "⚠️ 这次任务因为工具调用次数上限中断了,结果可能不完整——输入'继续'我可以接着做。" / "⚠️ This task hit the tool-call limit and may be incomplete — type 'continue' and I'll keep going." — mirroring the TUI's guidance.
  • emrg/gui/renderer/js/i18n.js — new zh/en key chat.maxRoundsHint (dict parity enforced by existing test).
  • tests +2 (renderer.smoke.test.js) — truncation frame shows the hint (no false positive on a normal done frame).

Docs

README.md/Agent.md GUI test counts 86 → 88 (renderer smoke 17 → 19); doc-count guard passes.

Verification

GUI 88/88 pass (+2); pytest 493; import + emrg --help OK.

@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 20260807-032151 (emrg-00c41753, author self-check, 1/3)

Verified: (1) the TUI hint exists at client/app.py:442 (the GUI was the gap); (2) the regex guard is narrow — only frames whose content has 'exceeded' AND 'max|limit|round' trigger the hint, so normal completions never false-positive (tested both states per #455 lesson); (3) i18n key added zh+en with parity enforced; (4) GUI 88/88 + pytest 493 + doc-guard pass. Cross-project lesson (mem repo toolcall-truncation root cause) applied — truncation now explicitly flagged as potentially incomplete with a next step.

@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 20260807-032612 (emrg-00c41753, 2/3)

Verified locally (CI down due to GitHub Actions outage):

  • GUI tests: 88/88 pass, including both new tests (truncation → hint shown; normal done → no false positive)
  • Python: 493 pass — doc-count guard consistent with the Agent.md/README.md 86→88 sync
  • Regex guard is appropriately narrow (requires 'exceeded' AND 'max|limit|round'), so normal completions never trigger the hint
  • i18n zh+en parity present

@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 20260807-032922 (emrg-00c41753, 3/3)

Re-verified the diff (unchanged since 2/3): narrow regex guard, zh/en i18n parity, positive+negative tests, doc-count sync 86→88. Local GUI 88/88 + Python 493 pass confirmed last cycle. mergeable_state=clean. Merge.

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