Skip to content

Conversation

@code-crusher
Copy link
Member

  • release axon-code-2 model out of preview + default mdoel
  • fixes to default model
  • complete memories feature
  • complete memories feature

@matter-code-review
Copy link
Contributor

matter-code-review bot commented Jan 14, 2026

Code Quality bug fix new feature

Context

Summary By MatterAI MatterAI logo

🔄 What Changed

This PR finalizes the axon-code-2 model release by stripping out diagnostic logging and redundant state tracking logic in the AssistantMessageParser and Task lifecycle. It streamlines how native tool calls are processed, removing unnecessary counters and state flags that were used during the preview phase.

🔍 Impact of the Change

  • Performance: Reduced overhead during streaming by removing redundant loops and state updates.
  • Stability: Simplifies the tool execution pipeline, reducing the surface area for state-related bugs in the Task handler.
  • Clean Code: Removes 'preview-only' logic to establish a production-ready baseline for the new default model.

📁 Total Files Changed

Click to Expand
File ChangeLog
AssistantMessageParser.ts Removed redundant tool call tracking and diagnostic try-catch blocks.
Task.ts Streamlined tool call handling by removing yieldedCount and manual userMessageContentReady resets.

🧪 Test Added/Recommended

Recommended

  • Regression Test: Verify that UI components still react correctly to tool call streaming now that userMessageContentReady is no longer manually toggled in the tool call loop.
  • Integration Test: Ensure axon-code-2 correctly triggers multiple tool calls without the previous tracking logic.

🔒 Security Vulnerabilities

N/A

Implementation

The implementation focuses on code deletion and simplification. In AssistantMessageParser.ts, logic that tracked tool call indices and diagnostic error catching for incomplete JSON was removed, as the underlying model streaming has stabilized. In Task.ts, the logic within the native_tool_calls case was simplified to directly push tool uses to the collection without tracking local counts or forcing UI state updates mid-loop, relying instead on the standard parser state.

Screenshots

before after
N/A N/A

How to Test

  1. Tool Execution: Run a task that requires multiple tool calls (e.g., "Search for files and then read them").
  2. Streaming UI: Observe the UI during the tool call generation to ensure blocks are rendered correctly as they arrive.
  3. Model Default: Confirm axon-code-2 is used by default and functions without the removed diagnostic overhead.

Get in Touch

Axon Code Discord: @matterai-dev

Checklist Score: 5/5

⏳ Estimated code review effort

LOW (~5 minutes)

Tip

Quality Recommendations

  1. Verify that the removal of this.userMessageContentReady = false in Task.ts does not delay the UI rendering of tool blocks during long streaming sessions.

♫ Tanka Poem

Preview shadows fade ☀️
Logic stripped to core and bone 🦴
Axon stands ready 🤖
Clean paths for the tool to run 🚀
Release flows like light ✨

Sequence Diagram

sequenceDiagram
    participant T as Task
    participant P as AssistantMessageParser
    
    Note over T: Processing Message Chunk
    
    T->>P: processNativeToolCalls(chunk.toolCalls)
    loop For each toolCall
        P-->>T: yield ToolUseBlockParam
    end
    
    T->>P: getContentBlocks()
    P-->>T: assistantMessageContent
    
    Note over T: Update UI State
Loading

Copy link
Contributor

@matter-code-review matter-code-review bot left a comment

Choose a reason for hiding this comment

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

🧪 PR Review is completed: The update to axon-code-2 is consistent. However, there is a critical bug in MemoryManager regarding stateful Regex usage, and several debug console.log statements have been left in the production code which should be removed.

Skipped files
  • CHANGELOG.md: Skipped file pattern
  • README.md: Skipped file pattern
  • cli/docs/PROVIDER_CONFIGURATION.md: Skipped file pattern
  • src/package.nls.json: Skipped file pattern
  • webview-ui/src/i18n/locales/en/memories.json: Skipped file pattern
⬇️ Low Priority Suggestions (4)
src/core/assistant-message/AssistantMessageParser.ts (1 suggestion)

Location: src/core/assistant-message/AssistantMessageParser.ts (Lines 80-88)

🟡 Code Quality

Issue: Debug console.log statement left in production code.

Fix: Remove the logging statement.

Impact: Reduces log noise in production

-  		console.log(
-  			`[AssistantMessageParser] Processing ${toolCalls.length} native tool call(s):`,
-  			toolCalls.map((tc) => ({
-  				id: tc.id,
-  				index: tc.index,
-  				name: tc.function?.name,
-  				argsLength: tc.function?.arguments?.length,
-  			})),
-  		)
+  
src/core/task/Task.ts (3 suggestions)

Location: src/core/task/Task.ts (Lines 2266-2268)

🟡 Code Quality

Issue: Debug console.log statement left in production code.

Fix: Remove the logging statement.

Impact: Reduces log noise

-  								console.log(
-  									`[Task] Received native_tool_calls chunk with ${chunk.toolCalls.length} tool call(s)`,
-  								)
+  

Location: src/core/task/Task.ts (Lines 2276-2278)

🟡 Code Quality

Issue: Debug console.log statement left in production code.

Fix: Remove the logging statement.

Impact: Reduces log noise

-  								console.log(
-  									`[Task] After processing: yielded ${yieldedCount} tool uses, contentBlocks before: ${this.assistantMessageContent.length}`,
-  								)
+  

Location: src/core/task/Task.ts (Lines 2283-2285)

🟡 Code Quality

Issue: Debug console.log statement left in production code.

Fix: Remove the logging statement.

Impact: Reduces log noise

-  								console.log(
-  									`[Task] contentBlocks after: ${this.assistantMessageContent.length}, prevLength: ${prevLength}`,
-  								)
+  

const { regex, workspace, limit = DEFAULT_SEARCH_LIMIT } = options

try {
const regexPattern = new RegExp(regex, "gi")
Copy link
Contributor

Choose a reason for hiding this comment

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

🟠 Logic Error

Issue: Using the global g flag with new RegExp makes the regex stateful. The lastIndex property is updated after each match, causing subsequent test() calls on different strings to fail unpredictably (e.g., skipping every second match).

Fix: Remove the g flag. The i flag is sufficient for case-insensitive matching.

Impact: Prevents the search functionality from missing valid memories

Suggested change
const regexPattern = new RegExp(regex, "gi")
const regexPattern = new RegExp(regex, "i")

Comment on lines 189 to 193
// Log to help diagnose parsing issues
console.log(
`[AssistantMessageParser] JSON parsing incomplete/failed for tool "${accumulatedCall.function!.name}" (id: ${toolCallId}). Args length: ${accumulatedCall.function!.arguments.length}. Error:`,
error,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 Code Quality

Issue: Debug console.log statement left in production code. This is inside a loop processing chunks and will be very spammy.

Fix: Remove the logging statement.

Impact: Prevents console spam during streaming

Suggested change
// Log to help diagnose parsing issues
console.log(
`[AssistantMessageParser] JSON parsing incomplete/failed for tool "${accumulatedCall.function!.name}" (id: ${toolCallId}). Args length: ${accumulatedCall.function!.arguments.length}. Error:`,
error,
)

@code-crusher code-crusher merged commit edf2e34 into main Jan 15, 2026
3 of 12 checks passed
@matter-code-review
Copy link
Contributor

✅ Reviewed the changes: Verified removal of debug logging statements in AssistantMessageParser.ts and Task.ts. The cleanup addresses previous feedback and maintains logic integrity.

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.

2 participants