app.js |
bug |
high |
CommandParser instantiated on every render (line 57) without memoization |
app.js |
bug |
high |
Massive code duplication: streaming callbacks and auto-continue logic duplicated ~4 times across handleCommand and handleChat |
app.js |
performance |
medium |
10+ functions (handleSubmit, handleCommand, handleChat, handleQuit, handleInterrupt, shouldAbort, handleNewSession, processOnboardingInput, getTimestamp, addMessage) defined inline without useCallback, causing recreation on every render |
app.js |
performance |
medium |
Token calculation logic duplicated in 3 places (lines 79-91, 567-577, 877-887) |
app.js |
bug |
medium |
Deeply nested React.createElement calls in render method (lines 1160-1213) — consider extracting sub-components |
contextTokens.js |
bug |
medium |
enc.free() only called in success path; encoder leaked if enc.encode() throws (line 30-41) |
markdownText.js |
performance |
medium |
new RegExp(STREAMING_CURSOR, "g") created on every render of MarkdownTextInner (line 150) — should be module-level constant |
memoryPanel.js |
style |
low |
Uses JSX syntax in .js file (not .jsx) |
skillsPanel.js |
style |
low |
Uses JSX syntax in .js file (not .jsx) |
settingsPanel.js |
style |
low |
Uses JSX syntax in .js file (not .jsx) |
hooks.js |
performance |
low |
createPanelState creates new object on every call with no caching |
components.js |
— |
— |
Simple re-export file, no issues |
index.js |
— |
— |
Barrel export file, no issues |
panels.js |
— |
— |
Simple utility, no issues |
messages.js |
— |
— |
Simple utility, no issues |
banner.js |
— |
— |
Simple component, no issues |
inputPanel.js |
— |
— |
Simple component, no issues |
statusBar.js |
— |
— |
Simple component, no issues |
onboardingPanel.js |
— |
— |
Simple component, no issues |
Audit Table
app.jsCommandParserinstantiated on every render (line 57) without memoizationapp.jshandleCommandandhandleChatapp.jshandleSubmit,handleCommand,handleChat,handleQuit,handleInterrupt,shouldAbort,handleNewSession,processOnboardingInput,getTimestamp,addMessage) defined inline withoutuseCallback, causing recreation on every renderapp.jsapp.jsReact.createElementcalls in render method (lines 1160-1213) — consider extracting sub-componentscontextTokens.jsenc.free()only called in success path; encoder leaked ifenc.encode()throws (line 30-41)markdownText.jsnew RegExp(STREAMING_CURSOR, "g")created on every render ofMarkdownTextInner(line 150) — should be module-level constantmemoryPanel.js.jsfile (not.jsx)skillsPanel.js.jsfile (not.jsx)settingsPanel.js.jsfile (not.jsx)hooks.jscreatePanelStatecreates new object on every call with no cachingcomponents.jsindex.jspanels.jsmessages.jsbanner.jsinputPanel.jsstatusBar.jsonboardingPanel.jsAudit Findings
Current Architecture
src/tools/subAgent.js— SubAgents are spawned as separatenode index.jsprocesses (line 113). Each subAgent is a full madz instance that reads its own config.yaml.src/provider/openai.js— Temperature is passed to ChatOpenAI at model creation time (line 24). Currently reads from provider config only.config.yaml— Temperature is configured atproviders.openai.temperature(line 9). SubAgent config lives underprocess.subAgent(lines 84-89) but has no temperature field.Integration Points
src/tools/subAgent.js:113—spawnSubAgentProcess()spawns the child process. This is where temperature would need to be passed (env var or CLI arg).src/tools/subAgent.js:258-274—resolveTimeout()shows the existing pattern: per-call > env var > config default. Temperature resolution should follow the same hierarchy.src/provider/openai.js:21-32—createChatModel()accepts temperature from config. The spawned process would need to override this with the subAgent-specific value.config.yaml:84-89—process.subAgentsection is the natural home for subAgent-specific config including temperature.Proposed Implementation Path
temperaturefield toprocess.subAgentin config.yaml (e.g.,0.7)MADZ_SUBAGENT_TEMPERATUREenv var inspawnSubAgentProcess()MADZ_SUBAGENT_TEMPERATUREis setConfig Schema Change