{
"impact": "critical",
"affected_modules": ["std/ai", "std/io"],
"reproduction": {
"steps": [
"Run motoko_agent with any task",
"Press Ctrl+C or send {"type":"abort"} to stdin during the AI step",
"Observe: the process does not stop until the LLM API call completes (potentially 30-120 seconds)"
]
},
"root_cause": "readLine() is only active in conversation_loop_v2 between tasks, not during dispatch_step() which invokes std/ai.step(). The Go HTTP client blocks without any cancellation mechanism.",
"proposed_solutions": [
{
"option": "A",
"description": "Add non-blocking stdin polling",
"details": "Provide stdin.poll() or stdin.available() that can be checked periodically, plus a way to interrupt blocking I/O from a separate goroutine"
},
{
"option": "B",
"description": "Context-propagating HTTP calls",
"details": "Wire Go context.Context through std/ai.step() so it can be cancelled by a signal handler"
},
{
"option": "C",
"description": "Signal handler integration",
"details": "Register Go signal handler for SIGINT/SIGTERM that cancels the AI call context"
}
],
"workaround": "Send SIGKILL instead of abort command, but this loses graceful shutdown (no run_summary event)",
"related": "motoko_agent src/core/agent_loop_v2.ail loop_v2 function"
}
Binary info (auto-attached):
ailang version: v0.18.9
binary md5: 78f841981769f1609824c24ef5c33148
binary path: /Users/mark/go/bin/ailang
git commit: fcd2b20-dirty
Reported by: motoko_explore via ailang messages
{
"impact": "critical",
"affected_modules": ["std/ai", "std/io"],
"reproduction": {
"steps": [
"Run motoko_agent with any task",
"Press Ctrl+C or send {"type":"abort"} to stdin during the AI step",
"Observe: the process does not stop until the LLM API call completes (potentially 30-120 seconds)"
]
},
"root_cause": "readLine() is only active in conversation_loop_v2 between tasks, not during dispatch_step() which invokes std/ai.step(). The Go HTTP client blocks without any cancellation mechanism.",
"proposed_solutions": [
{
"option": "A",
"description": "Add non-blocking stdin polling",
"details": "Provide stdin.poll() or stdin.available() that can be checked periodically, plus a way to interrupt blocking I/O from a separate goroutine"
},
{
"option": "B",
"description": "Context-propagating HTTP calls",
"details": "Wire Go context.Context through std/ai.step() so it can be cancelled by a signal handler"
},
{
"option": "C",
"description": "Signal handler integration",
"details": "Register Go signal handler for SIGINT/SIGTERM that cancels the AI call context"
}
],
"workaround": "Send SIGKILL instead of abort command, but this loses graceful shutdown (no run_summary event)",
"related": "motoko_agent src/core/agent_loop_v2.ail loop_v2 function"
}
Binary info (auto-attached):
ailang version: v0.18.9
binary md5: 78f841981769f1609824c24ef5c33148
binary path: /Users/mark/go/bin/ailang
git commit: fcd2b20-dirty
Reported by: motoko_explore via ailang messages