()
| 303 | |
| 304 | /* run model */ |
| 305 | const handleRunModel = async () => { |
| 306 | if (isRunningModel || !currentModel) return; |
| 307 | setIsRunningModel(true); |
| 308 | setTestOutput((p) => 'SYSTEM: running model...\\n' + p); |
| 309 | try { |
| 310 | const r = await executeTestIteration( |
| 311 | agentId || 'test-agent', |
| 312 | systemPrompt, |
| 313 | currentModel, |
| 314 | getToken |
| 315 | ); |
| 316 | setTestResponse(r); |
| 317 | setTestOutput((p) => `SYSTEM: model returned (${r.length} chars)\\n` + p); |
| 318 | testResponseRef.current?.focus(); |
| 319 | } catch (e) { |
| 320 | setTestOutput( |
| 321 | (p) => `ERROR: ${e instanceof Error ? e.message : String(e)}\\n` + p |
| 322 | ); |
| 323 | } finally { |
| 324 | setIsRunningModel(false); |
| 325 | } |
| 326 | }; |
| 327 | |
| 328 | /* run code */ |
| 329 | const handleRunCode = async () => { |
nothing calls this directly
no test coverage detected