mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 23:01:56 +00:00
Fix AGENTS.md support, changelog viewer, and session model storage
- BREAKING: Renamed AGENT.md to AGENTS.md for project context files - Added automatic changelog viewer on startup for new sessions - Added settings manager to track last shown changelog version - BREAKING: Store provider and modelId separately in session files (fixes #4) - Fixed markdown list rendering when items contain inline code with cyan formatting - Added dynamic border component for TUI - Updated changelog with entries for #4 and #5
This commit is contained in:
parent
c23f1576dc
commit
fede1303b1
5 changed files with 45 additions and 30 deletions
|
|
@ -527,21 +527,19 @@ export async function main(args: string[]) {
|
|||
// Load and restore model
|
||||
const savedModel = sessionManager.loadModel();
|
||||
if (savedModel) {
|
||||
// Parse provider/modelId from saved model string (format: "provider/modelId")
|
||||
// Some providers or model IDs may contain slashes, so split only on the first slash.
|
||||
// For example, "openrouter/x-ai/grok-4-fast" -> provider: "openrouter", modelId: "x-ai/grok-4-fast".
|
||||
const [savedProvider, savedModelId] = savedModel.split("/", 1);
|
||||
if (savedProvider && savedModelId) {
|
||||
try {
|
||||
const restoredModel = getModel(savedProvider as any, savedModelId);
|
||||
agent.setModel(restoredModel);
|
||||
if (shouldPrintMessages) {
|
||||
console.log(chalk.dim(`Restored model: ${savedModel}`));
|
||||
}
|
||||
} catch (error: any) {
|
||||
if (shouldPrintMessages) {
|
||||
console.error(chalk.yellow(`Warning: Could not restore model ${savedModel}: ${error.message}`));
|
||||
}
|
||||
try {
|
||||
const restoredModel = getModel(savedModel.provider as any, savedModel.modelId);
|
||||
agent.setModel(restoredModel);
|
||||
if (shouldPrintMessages) {
|
||||
console.log(chalk.dim(`Restored model: ${savedModel.provider}/${savedModel.modelId}`));
|
||||
}
|
||||
} catch (error: any) {
|
||||
if (shouldPrintMessages) {
|
||||
console.error(
|
||||
chalk.yellow(
|
||||
`Warning: Could not restore model ${savedModel.provider}/${savedModel.modelId}: ${error.message}`,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue