mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
refactor: improve error handling and CLI integration
- Updated CodexProvider to read prompts from stdin to prevent shell escaping issues. - Enhanced AgentService to handle streamed error messages from providers, ensuring a consistent user experience. - Modified UI components to display error messages clearly, including visual indicators for errors in chat bubbles. - Updated CLI status handling to support both Claude and Codex APIs, improving compatibility and user feedback. These changes enhance the robustness of the application and improve the user experience during error scenarios.
This commit is contained in:
@@ -44,11 +44,15 @@ export async function* spawnJSONLProcess(options: SubprocessOptions): AsyncGener
|
||||
console.log(`[SubprocessManager] Passing ${stdinData.length} bytes via stdin`);
|
||||
}
|
||||
|
||||
// On Windows, .cmd files must be run through shell (cmd.exe)
|
||||
const needsShell = process.platform === 'win32' && command.toLowerCase().endsWith('.cmd');
|
||||
|
||||
const childProcess: ChildProcess = spawn(command, args, {
|
||||
cwd,
|
||||
env: processEnv,
|
||||
// Use 'pipe' for stdin when we need to write data, otherwise 'ignore'
|
||||
stdio: [stdinData ? 'pipe' : 'ignore', 'pipe', 'pipe'],
|
||||
shell: needsShell,
|
||||
});
|
||||
|
||||
// Write stdin data if provided
|
||||
@@ -194,10 +198,14 @@ export async function spawnProcess(options: SubprocessOptions): Promise<Subproce
|
||||
};
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// On Windows, .cmd files must be run through shell (cmd.exe)
|
||||
const needsShell = process.platform === 'win32' && command.toLowerCase().endsWith('.cmd');
|
||||
|
||||
const childProcess = spawn(command, args, {
|
||||
cwd,
|
||||
env: processEnv,
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
shell: needsShell,
|
||||
});
|
||||
|
||||
let stdout = '';
|
||||
|
||||
Reference in New Issue
Block a user