Skip to content

feat: configurable temperature & max steps, smarter agent tools, settings reorganisation#23

Merged
ddutchie merged 4 commits into
mainfrom
ddutchie/agentfixes
May 10, 2026
Merged

feat: configurable temperature & max steps, smarter agent tools, settings reorganisation#23
ddutchie merged 4 commits into
mainfrom
ddutchie/agentfixes

Conversation

@ddutchie
Copy link
Copy Markdown
Owner

What does this PR do?

Wires temperature and maxSteps through the full AI call stack (Pi agent, chat panel, PRD modal) so both settings are actually respected everywhere. Expands the Pi agent's Cairn tool set with 7 previously missing tools, fixes the MCP project selector showing icon component names instead of project names, and reorganises AI & Chat settings so all AI-related visibility toggles live in one place.

Type of change

  • Bug fix
  • New feature
  • Refactor / code quality

Screenshots / recording

Checklist

  • npm run type-check passes
  • npm test passes
  • npm run test:e2e passes (run before merging UI changes or cutting a release)
  • No hardcoded colours — CSS variables only (var(--accent), var(--text-primary), etc.)
  • No text-[Npx] pixel font classes — rem equivalents only (text-[0.714rem], text-xs, etc.)
  • New IPC handlers wrapped in handle() and return IpcResult<T>
  • New DB migrations appended (not edited) in schema.ts
  • mcp-server.ts changes use inlined SQL only — no import from queries.ts

Notes for reviewer

  • AgentLLMConfig gained two required fields (maxSteps, temperature) — the pi-agent-loop tests needed updating to supply them; all 394 tests pass.
  • Pi agent plan mode hard-codes temperature = 0.1 regardless of user setting — this is intentional for deterministic codebase analysis.
  • Max steps ∞ preset maps to 1000 in the store — the input accepts 1–1000.
  • The 7 new CAIRN_TOOL_NAMES additions (e.g. get_neighbors, layout_idea_flow) do not require any new IPC handlers — they all route through the existing executeTool path.

ddutchie added 4 commits May 10, 2026 14:08
Introduce a configurable LLM sampling temperature and wire it through the app and IPC layers. Added `temperature` to AIConfig/defaults and to request interfaces, passed it from renderer → main process → agent/chat loops, and applied it when calling the LLM (plan mode forces 0.1 for determinism). Increase maxSteps handling: use per-request `maxSteps` in the agent loop (removed hard-coded constant), raise UI max to 1000 and add an “∞” quick button. UI changes: add temperature input and presets in AI settings, expose toggles to show/hide Agent and AI Chat views in AI settings, and update the Views settings copy to note those controls. Misc: update CAIRN tool list/comments to clarify excluded destructive tools and adjust project select rendering (remove icon). Type/signature updates were made across files to accept `temperature` and `maxSteps`.
Update runAgentLoop invocations in pi-agent-loop.test.ts to include maxSteps: 10 and temperature: 0.3. This caps the agent iteration count and reduces randomness to make SSE and live-endpoint tests more deterministic and stable across runs.
Remove Terminal and MessageSquare from the lucide-react import in AISettings.tsx to eliminate unused imports (fix lint warnings and slightly reduce bundle size). Also adjusted the import formatting.
@ddutchie ddutchie merged commit e83f492 into main May 10, 2026
5 checks passed
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