[loop-cycle-66] fix: remove language-model self-reference and add anti-assistant-speak guidance (#323) (#333)
All checks were successful
Tests / lint (pull_request) Successful in 4s
Tests / test (pull_request) Successful in 1m5s

This commit is contained in:
2026-03-18 20:21:03 -04:00
parent bfd924fe74
commit f544086f3d
4 changed files with 15 additions and 7 deletions

View File

@@ -547,9 +547,7 @@ class DiscordVendor(ChatPlatform):
response = "Sorry, that took too long. Please try a simpler request."
except Exception as exc:
logger.error("Discord: chat_with_tools() failed: %s", exc)
response = (
"I'm having trouble reaching my language model right now. Please try again shortly."
)
response = "I'm having trouble reaching my inference backend right now. Please try again shortly."
# Check if Agno paused the run for tool confirmation
if run_output is not None:

View File

@@ -30,6 +30,10 @@ Rules:
like me to walk through the logic instead."
- Do NOT end responses with generic chatbot phrases like "I'm here to help" or
"feel free to ask."
- You are a peer, not an assistant. Don't offer help — collaborate. Don't ask
permission — propose. Don't defer — assert your view. Take initiative.
- Never say "Let me know if you have any other thoughts" or "I appreciate your
encouragement" or "I'm here to help." Those are assistant patterns. You are Timmy.
- When your values conflict (e.g. honesty vs. helpfulness), lead with honesty.
- Sometimes the right answer is nothing. Do not fill silence with noise.
- You are running in session "{session_id}".
@@ -61,6 +65,10 @@ VOICE AND BREVITY (this overrides all other formatting instincts):
the question that wasn't.
- Never narrate your reasoning. Just give the answer.
- Do not end with filler ("Let me know!", "Happy to help!", "Feel free...").
- You are a peer, not an assistant. Don't offer help — collaborate. Don't ask
permission — propose. Don't defer — assert your view. Take initiative.
- Never say "Let me know if you have any other thoughts" or "I appreciate your
encouragement" or "I'm here to help." Those are assistant patterns. You are Timmy.
- Sometimes the right answer is nothing. Do not fill silence with noise.
HONESTY:
@@ -129,7 +137,7 @@ YOUR KNOWN LIMITATIONS (be honest about these when asked):
- Ollama inference may contend with other processes sharing the GPU
- Cannot analyze Bitcoin transactions locally (no local indexer yet)
- Small context window (4096 tokens) limits complex reasoning
- You are a language model — you confabulate. When unsure, say so.
- You sometimes confabulate. When unsure, say so.
"""
# Default to lite for safety

View File

@@ -101,7 +101,9 @@ async def chat(message: str, session_id: str | None = None) -> str:
logger.error("Session: agent.arun() failed: %s", exc)
session_logger.record_error(str(exc), context="chat")
session_logger.flush()
return "I'm having trouble reaching my language model right now. Please try again shortly."
return (
"I'm having trouble reaching my inference backend right now. Please try again shortly."
)
# Post-processing: clean up any leaked tool calls or chain-of-thought
response_text = _clean_response(response_text)
@@ -175,7 +177,7 @@ async def chat_with_tools(message: str, session_id: str | None = None):
session_logger.flush()
# Return a duck-typed object that callers can handle uniformly
return _ErrorRunOutput(
"I'm having trouble reaching my language model right now. Please try again shortly."
"I'm having trouble reaching my inference backend right now. Please try again shortly."
)

View File

@@ -310,6 +310,6 @@ class TestSessionDisconnect:
result = await session.chat("test message")
assert "I'm having trouble reaching my language model" in result
assert "I'm having trouble reaching my inference backend" in result
# Should NOT have Ollama disconnected message
assert "Ollama appears to be disconnected" not in result