Skip to content

fix: replace simulated AI response with real LLM client calls#51

Merged
JohnVictorCrown merged 1 commit into
masterfrom
session/agent_ee61815c-4b16-49ef-9fc0-2017ddde53c8
Feb 14, 2026
Merged

fix: replace simulated AI response with real LLM client calls#51
JohnVictorCrown merged 1 commit into
masterfrom
session/agent_ee61815c-4b16-49ef-9fc0-2017ddde53c8

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

Summary

The handleQuery method in server/server.go was returning a hardcoded "Simulated AI response to: ..." string instead of making real LLM API calls. This PR fixes that by wiring up the actual LLM client.

Changes

server/server.go

  • Removed AgentStub placeholder struct that had no LLM functionality
  • Added llm.Client, llm.MessageHistory, and SystemPrompt fields to ChatSession
  • handleInitAgent: Now creates a real LLM client (OpenAI, Anthropic, or Gemini) based on the model name provided in the init message. API keys are read from environment variables (LLM_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY)
  • handleQuery: Replaced the simulated response with a real call to llm.Client.Generate(), maintaining message history and using the system prompt from the prompts package

server/server_test.go

  • Updated TestAgentStubTestChatSessionFields to reflect the removed AgentStub type

What was NOT changed

  • System prompts (in prompts/prompts.go) are untouched
  • LLM client implementations (llm/openai.go, llm/anthropic.go, llm/gemini.go) are untouched
  • All other server functionality remains the same

Built for stellar.foundation.us by Kilo for Slack

- Remove AgentStub placeholder and wire up real llm.Client in ChatSession
- handleInitAgent now creates a real LLM client (OpenAI/Anthropic/Gemini) based on model name
- handleQuery now calls llm.Client.Generate() instead of returning hardcoded string
- API keys read from environment variables (LLM_API_KEY, OPENAI_API_KEY, etc.)
- System prompt loaded from prompts package (unchanged)
- Update server_test.go to reflect removed AgentStub
@JohnVictorCrown
JohnVictorCrown merged commit 3d33dd7 into master Feb 14, 2026
2 checks passed
@JohnVictorCrown
JohnVictorCrown deleted the session/agent_ee61815c-4b16-49ef-9fc0-2017ddde53c8 branch February 14, 2026 01:24
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