Skip to content

fix(acp,agent): support reasoning_content fallback and turn text publishing for local reasoning models - #3403

Open
mainza-ai wants to merge 16 commits into
block:mainfrom
mainza-ai:fix/acp-reasoning-content-and-turn-text-publishing
Open

fix(acp,agent): support reasoning_content fallback and turn text publishing for local reasoning models#3403
mainza-ai wants to merge 16 commits into
block:mainfrom
mainza-ai:fix/acp-reasoning-content-and-turn-text-publishing

Conversation

@mainza-ai

@mainza-ai mainza-ai commented Jul 28, 2026

Copy link
Copy Markdown

Summary

This PR fixes core issues when running AI agents via buzz-acp and buzz-agent with local OpenAI-compatible reasoning models (e.g. 4-bit Gemma models served on OMLX/Ollama endpoints):

  1. Reasoning Content Fallback: Local reasoning models output generated text inside reasoning_content or reasoning while returning content: "" (without tool_calls). Updates parse_openai and parse_responses in buzz-agent/src/llm.rs so text falls back to reasoning when content is empty.
  2. Turn Text Accumulation & Fallback Channel Publishing: Non-tool-calling models do not invoke buzz messages send. buzz-acp now accumulates agent_message_chunk updates during a turn and automatically posts the cleaned turn text as a signed kind: 9 message event to the channel thread on StopReason::EndTurn.
  3. Response Sanitization: Adds clean_agent_text_response in pool.rs to strip pseudo-tool JSON blocks (json {"reply_to": ...} ) and special model tokens (<|tool_call>, <|im_end|>) before channel publishing.

Testing & Verification

  • Tested with local OMLX OpenAI-compatible endpoint (http://127.0.0.1:8787/v1) using Gemma-4 reasoning models.
  • Verified agent messages stream and render directly in channel threads without leaking raw pseudo-tool JSON.
  • Verified Rust workspace compilation and unit test suite pass (cargo test -p buzz-acp -p buzz-agent).

…ing, and wiki troubleshooting

Signed-off-by: mainza-ai <mainza@gmail.com>
Signed-off-by: mainza-ai <mainza@gmail.com>
@mainza-ai
mainza-ai requested a review from a team as a code owner July 28, 2026 21:25
mainza-ai added 10 commits July 28, 2026 16:26
Signed-off-by: mainza-ai <mainza@gmail.com>
… AgentDefinition

Signed-off-by: mainza-ai <mainza@gmail.com>
… AgentDefinition

Signed-off-by: mainza-ai <mainza@gmail.com>
…team

Signed-off-by: mainza-ai <mainza@gmail.com>
…team

Signed-off-by: mainza-ai <mainza@gmail.com>
…urn text

Signed-off-by: mainza-ai <mainza@gmail.com>
…ishing

Signed-off-by: mainza-ai <mainza@gmail.com>
…do-code cleaning and duplicate card fixes

Signed-off-by: mainza-ai <mainza@gmail.com>
…annel discovery

Signed-off-by: mainza-ai <mainza@gmail.com>
…el discovery

Signed-off-by: mainza-ai <mainza@gmail.com>
@mainza-ai

Copy link
Copy Markdown
Author

Update: Multi-Tenant Loopback Host Normalization & Realtime NIP-29 Channel Discovery

This PR has been updated with surgical fixes resolving multi-tenant loopback isolation and realtime channel discovery for mentioned agents:

  1. Multi-Tenant Loopback Host Normalization ( & ):

    • now folds local loopback host variants (, , ) into .
    • Ensures clients connecting across or map to the exact same Postgres .
    • Normalizes NIP-98 authentication URL host verification to prevent 401 URL mismatch errors during local development.
  2. Realtime NIP-29 Channel Discovery ():

    • now inspects both tags (NIP-29 group members ) and tags.
    • Enables to dynamically subscribe to channels in real time as soon as an agent is added to a new channel.
  3. Verification:

    • All workspace unit tests passed (, , , , ).
    • , , Biome linting, and desktop file size checks are 100% green.

Signed-off-by: mainza-ai <mainza@gmail.com>
Signed-off-by: mainza-ai <mainza@gmail.com>
Signed-off-by: mainza-ai <mainza@gmail.com>
Signed-off-by: mainza-ai <mainza@gmail.com>
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