fix(agent-loop): notify type (#608)

## Description

The `as AppConfig` type assertion in the constructor may introduce
potential type safety risks. Removing the assertion and making `notify`
an optional parameter could enhance type robustness and prevent
unexpected runtime errors.

close: #605
This commit is contained in:
Luci
2025-04-25 02:08:52 +08:00
committed by GitHub
parent d1c0d5e683
commit e84fa6793d
3 changed files with 6 additions and 8 deletions

View File

@@ -141,7 +141,7 @@ export default function TerminalChat({
additionalWritableRoots,
fullStdout,
}: Props): React.ReactElement {
const notify = config.notify;
const notify = Boolean(config.notify);
const [model, setModel] = useState<string>(config.model);
const [provider, setProvider] = useState<string>(config.provider || "openai");
const [lastResponseId, setLastResponseId] = useState<string | null>(null);