Skip to content

Fix CLI session import fallback model default#1386

Closed
trucuit wants to merge 1 commit intonesquena:masterfrom
trucuit:master
Closed

Fix CLI session import fallback model default#1386
trucuit wants to merge 1 commit intonesquena:masterfrom
trucuit:master

Conversation

@trucuit
Copy link
Copy Markdown

@trucuit trucuit commented May 1, 2026

Fixes a crash in CLI session import by defaulting model to 'unknown' when metadata is missing.

This avoids UnboundLocalError during POST /api/session/import_cli and allows CLI sessions without metadata to import successfully.

@nesquena-hermes
Copy link
Copy Markdown
Collaborator

Thanks — this is a valid defensive fix. In _handle_session_import_cli, model is only assigned inside the for cs in get_cli_sessions(): if cs["session_id"] == sid: block, so if the messages are present in the CLI store but the session metadata is missing from get_cli_sessions() (partial/stale state), model would be unbound by the time import_cli_session(...) is called.

Adding model = "unknown" alongside the other pre-loop defaults (profile, created_at, updated_at, cli_title, cli_source_tag) matches the existing pattern in that function. Queued for maintainer review and merge.

@nesquena-hermes
Copy link
Copy Markdown
Collaborator

Released as part of v0.50.252 — thanks @trucuit!

This PR was merged into the v0.50.252 release batch via #1387 alongside 5 other contributor fixes. The full CHANGELOG entry is at https://github.com/nesquena/hermes-webui/blob/master/CHANGELOG.md.

Pre-release verification: 3507 pytest tests pass, full QA harness pass (20 structural + 11 browser API + 23 Agent Browser CDP), Opus mentor APPROVED with two non-blocking follow-ups applied during the release batch (force=True on agent redactor, debug-log on profile fallback).

Closing this PR — the change is live on master.

pull Bot pushed a commit to JamesWilliam1977/hermes-webui that referenced this pull request May 1, 2026
pull Bot pushed a commit to JamesWilliam1977/hermes-webui that referenced this pull request May 1, 2026
GeoffBao pushed a commit to GeoffBao/hermes-webui that referenced this pull request May 1, 2026
GeoffBao pushed a commit to GeoffBao/hermes-webui that referenced this pull request May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants