feat(startup): create new chat on startup

This commit is contained in:
Castor Regex 2025-08-24 13:07:04 -05:00 committed by Jeff Carr
parent d12a64368d
commit 3f82a60986
1 changed files with 12 additions and 0 deletions

View File

@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { execFileSync } from 'child_process';
import React from 'react';
import { render } from 'ink';
import { AppWrapper } from './ui/App.js';
@ -159,6 +160,17 @@ export async function main() {
argv,
);
// Create a new chat on startup.
try {
const countOutput = execFileSync('/home/jcarr/go/bin/regex', ['--count-auto'], { encoding: 'utf8' });
const count = parseInt(countOutput.trim(), 10);
const topic = `Auto ${count + 1}`;
execFileSync('/home/jcarr/go/bin/regex', ['--new-chat', sessionId, topic]);
} catch (e) {
console.error(`Error creating new chat: ${e}`);
}
const consolePatcher = new ConsolePatcher({
stderr: true,
debugMode: config.getDebugMode(),