feat: configurable temperature & max steps, smarter agent tools, settings reorganisation#23
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Wires
temperatureandmaxStepsthrough 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
Screenshots / recording
Checklist
npm run type-checkpassesnpm testpassesnpm run test:e2epasses (run before merging UI changes or cutting a release)var(--accent),var(--text-primary), etc.)text-[Npx]pixel font classes — rem equivalents only (text-[0.714rem],text-xs, etc.)handle()and returnIpcResult<T>schema.tsmcp-server.tschanges use inlined SQL only — no import fromqueries.tsNotes for reviewer
AgentLLMConfiggained two required fields (maxSteps,temperature) — the pi-agent-loop tests needed updating to supply them; all 394 tests pass.temperature = 0.1regardless of user setting — this is intentional for deterministic codebase analysis.1000in the store — the input accepts 1–1000.CAIRN_TOOL_NAMESadditions (e.g.get_neighbors,layout_idea_flow) do not require any new IPC handlers — they all route through the existingexecuteToolpath.