Commit Graph

65 Commits

Author SHA1 Message Date
Re-bin
aeb07d3450 refactor(loop): remove interim text retry, use system prompt constraint instead 2026-02-21 07:32:58 +00:00
Re-bin
8bb849470b Merge branch 'main' into pr-887 2026-02-21 07:12:58 +00:00
Re-bin
9a31571b6d fix: don't append interim assistant message before retry to avoid prefill errors 2026-02-20 16:51:37 +00:00
Re-bin
7279ff0167 refactor: route CLI interactive mode through message bus for subagent support 2026-02-20 16:45:21 +00:00
Re-bin
80b5e6cea0 Merge branch 'main' into pr-892 2026-02-20 16:06:17 +00:00
Re-bin
132807a3fb refactor: simplify message tool turn tracking to a single boolean flag 2026-02-20 15:55:30 +00:00
Nikolas de Hor
37222f9c0a fix: add connecting guard to prevent concurrent MCP connection attempts
Addresses Codex review: concurrent callers could both pass the
_mcp_connected guard and race through _connect_mcp(). Added
_mcp_connecting flag set immediately to serialize attempts.
2026-02-20 09:38:22 -03:00
Nikolas de Hor
45f33853cf fix: only apply interim fallback when no tools were used
Addresses Codex review: if the model sent interim text then used tools,
the interim text should not be used as fallback for the final response.
2026-02-20 09:37:42 -03:00
Kim
8cc54b188d style(logging): use loguru parameterized formatting in suppression log 2026-02-20 20:25:46 +08:00
Nikolas de Hor
44f44b305a fix: move MCP connected flag after successful connection to allow retry
The flag was set before the connection attempt, so if any MCP server
was temporarily unavailable, the flag stayed True and MCP tools were
permanently lost for the session.

Closes #889
2026-02-20 09:24:48 -03:00
Nikolas de Hor
4eb07c44b9 fix: preserve interim content as fallback when retry produces empty response
Fixes regression from #825 where models that respond with final text
directly (no tools) had their answer discarded by the retry mechanism.

Closes #878
2026-02-20 09:21:27 -03:00
Kim
ddae3e9d5f fix(agent): avoid duplicate final send when message tool already replied 2026-02-20 20:16:45 +08:00
Re-bin
8db91f59e2 style: remove trailing space 2026-02-20 11:18:57 +00:00
Re-bin
b73e847e89 Merge branch 'main' into pr-833 2026-02-20 11:16:49 +00:00
Re-bin
44eb1bdca2 Merge branch 'main' into pr-815 2026-02-20 08:57:02 +00:00
Re-bin
686471bd8d Merge branch 'main' into pr-823 2026-02-20 08:33:45 +00:00
Re-bin
2383dcb3a8 style: use loguru native format and trim comments in interim retry 2026-02-20 08:31:48 +00:00
Re-bin
0660d614f6 Merge branch 'main' into pr-825 2026-02-20 08:24:26 +00:00
Re-bin
a9bffdc06f Merge branch 'main' into pr-644 2026-02-20 08:08:55 +00:00
Re-bin
55ac4b729e Merge branch 'main' into pr-653 2026-02-20 08:01:08 +00:00
Re-bin
73fdd0dd45 fix: complete ensure_ascii=False and UTF-8 encoding migration 2026-02-20 07:59:32 +00:00
Re-bin
37252a4226 fix: complete loguru native formatting migration across all files 2026-02-20 07:55:34 +00:00
Nikolas de Hor
53b83a38e2 fix: use loguru native formatting to prevent KeyError on messages containing curly braces
Closes #857
2026-02-19 17:19:36 -03:00
Nikolas de Hor
1b49bf9602 fix: avoid duplicate messages on retry and reset final_content
Address review feedback:
- Remove on_progress call for interim text to prevent duplicate
  messages when the model simply answers a direct question
- Reset final_content to None before continue to avoid stale
  interim text leaking as the final response on empty retry

Closes #705
2026-02-19 10:26:49 -03:00
Darye
523b2982f4 fix: fixed not logging tool uses if a think fragment had them attached.
if a think fragment had a tool attached, the tool use would not log. now it does
2026-02-19 05:22:00 +01:00
chtangwin
c7b5dd9350 Fix: Ensure UTF-8 encoding for all file operations 2026-02-18 18:28:54 -08:00
Nikolas de Hor
464352c664 fix: allow one retry for models that send interim text before tool calls
Some LLM providers (MiniMax, Gemini Flash, GPT-4.1, etc.) send an
initial text-only response like "Let me investigate..." before actually
making tool calls. The agent loop previously broke immediately on any
text response without tool calls, preventing these models from ever
using tools.

Now, when the model responds with text but hasn't used any tools yet,
the loop forwards the text as progress to the user and gives the model
one additional iteration to make tool calls. This is limited to a
single retry to prevent infinite loops.

Closes #705
2026-02-18 21:31:12 -03:00
Nikolas de Hor
107a380e61 fix: prevent duplicate memory consolidation tasks per session
Add a `_consolidating` set to track which sessions have an active
consolidation task. Skip creating a new task if one is already in
progress for the same session key, and clean up the flag when done.

This prevents the excessive API calls reported when messages exceed
the memory_window threshold — previously every single message after
the threshold triggered a new background consolidation.

Closes #751
2026-02-18 21:31:09 -03:00
Darye
c865b293a9 feat: enhance message context handling by adding message_id parameter 2026-02-18 20:18:27 +01:00
Re-bin
715b2db24b feat: stream intermediate progress to user during tool execution 2026-02-18 14:23:51 +00:00
Harry Zhou
40f4834f30 Merge remote-tracking branch 'upstream/main' 2026-02-16 11:40:07 +08:00
Re-bin
49fec3684a fix: use json_repair for robust LLM response parsing 2026-02-15 08:11:33 +00:00
Re-bin
52cf1da30a fix: store original MCP tool name, make close_mcp public 2026-02-15 07:00:27 +00:00
Re-bin
54d5f637e7 merge main into pr-554 2026-02-15 06:12:15 +00:00
Oleg Medvedev
fbbbdc727d fix(tools): resolve relative file paths against workspace
File tools now resolve relative paths (e.g., "test.txt") against the
workspace directory instead of the current working directory. This fixes
failures when models use simple filenames instead of full paths.

- Add workspace parameter to _resolve_path() in filesystem.py
- Update all file tools to accept workspace in constructor
- Pass workspace when registering tools in AgentLoop
2026-02-14 13:51:18 -06:00
Harry Zhou
b523b277b0 fix(agent): handle non-string values in memory consolidation
Fix TypeError when LLM returns JSON objects instead of strings for
history_entry or memory_update.

Changes:
- Update prompt to explicitly require string values with example
- Add type checking and conversion for non-string values
- Use json.dumps() for consistent JSON formatting

Fixes potential memory consolidation failures when LLM interprets
the prompt loosely and returns structured objects instead of strings.
2026-02-14 23:48:21 +08:00
Re-bin
f821e95d3c fix: wire max_tokens/temperature to all chat calls, clean up redundant comments 2026-02-14 01:40:37 +00:00
Re-bin
155fc48b29 merge: resolve conflict with main, keep extracted _run_agent_loop with temperature 2026-02-14 01:22:17 +00:00
Re-bin
2f2c55f921 fix: add missing comma and type annotation for temperature param 2026-02-14 01:13:49 +00:00
chengyongru
98a762452a fix: useasyncio.create_task to avoid block 2026-02-13 15:36:04 +08:00
chengyongru
740294fd74 fix: history messages should not be change[kvcache] 2026-02-13 15:10:07 +08:00
wymcmh
3e9f6d0b6b Merge branch 'main' into fix/config-temperature 2026-02-13 13:07:37 +08:00
Xubin Ren
5c398c5faf Merge pull request #567 from 3927o/feature/better-fallback-message
Add max iterations info to fallback message
2026-02-13 12:55:14 +08:00
Re-bin
903caaa642 feat: unified slash commands (/new, /help) across all channels 2026-02-13 03:30:21 +00:00
3927o
dbbbecb25c feat: improve fallback message when max iterations reached 2026-02-12 23:57:34 +08:00
Re-bin
94c21fc235 feat: redesign memory system — two-layer architecture with grep-based retrieval 2026-02-12 15:02:52 +00:00
lemon
a3599b97b9 fix: bug #370, support temperature configuration 2026-02-12 19:12:38 +08:00
Sergio Sánchez Vallés
61e9f7f58a chore: revert unrelated changes, keep only MCP support 2026-02-12 10:17:44 +01:00
Sergio Sánchez Vallés
e89afe61f1 feat(tools): add mcp support 2026-02-12 10:09:00 +01:00
Re-bin
d335494212 feat: add interleaved chain-of-thought to agent loop 2026-02-12 06:25:25 +00:00