Skip to content

fix(claude): serialize model and effort in App session metadata - #1443

Closed
Neonforge98 wants to merge 1 commit into
developfrom
codex/fix-claude-desktop-effort
Closed

Neonforge98 wants to merge 1 commit into
developfrom
codex/fix-claude-desktop-effort

Conversation

@Neonforge98

@Neonforge98 Neonforge98 commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

ORG2's existing Claude App catalog publisher writes the ORG2 model variant (for example claude-fable-5-1-high) into the native metadata model field. Claude App stores the base model and effort separately. This is a publication-format defect; ordinary Claude Code execution already passes a separate --effort flag and is not repaired by this PR.

Solution

Reuse the existing Claude CLI model-variant parser at the metadata writer. Publish the base model and explicit effort separately, preserve existing effort when no override is selected, and retain unrelated provider-owned fields. Regression coverage exercises five effort variants and updates to existing records.

This changes the existing catalog publication only. The catalog record carries the native session ID, working directory, title, timestamps and settings so Claude App can load a session whose conversation remains in the native JSONL transcript. It is not a runtime settings API.

Potential risks

End-to-end first-import effort preservation is still blocked in the installed Claude App. Its resume URL handler forwards only the session UUID to importCliSession. For a session absent from its memory, adoptCliSession rebuilds a record from the transcript; its imported settings include model and permissions but omit effort. The resulting record can overwrite the correctly published metadata. App setEffort updates memory, disk and the active query, but the inspected resume URL does not expose that operation. This PR does not claim to repair that App-owned path and remains Draft for the requested complete handoff behavior.

Two successful High continuations (ORG2 and Claude App) have native transcript effort=high. This disproves the inference that a Low display necessarily means a Low request; it does not establish preservation for every effort level. No automatic App restart, global effort override, private runtime injection or vendor-bundle modification is introduced.

The provider-owned metadata format may change. No schema migration, dependency change, new timer or scan is introduced. Existing records are corrected on ordinary publication, with no bulk history rewrite. Revert the commit and rebuild to restore the previous writer; native conversations remain intact. Cross-process metadata ownership and App discovery cadence are unchanged.

Verification

  • Original regression reproduced the unsplit model defect before the fix.
  • Earlier CLI suite: 457 passed, 3 ignored; earlier cargo clippy and PR CI passed. These results preceded the latest develop integration.
  • Rebased onto develop after fix(codex): register Desktop projects and bind managed threads #1442 and fix(cli): reconcile native history after terminal events #1444 merged, without conflicts; the diff remains limited to the metadata publisher, its regression test and shared parser visibility.
  • git diff --check origin/develop...HEAD passed after integration; inspected both changed files for unrelated changes and private data.
  • After integration: CARGO_TARGET_DIR=<shared-target> cargo test --manifest-path src-tauri/Cargo.toml --lib claude_desktop_publication_preserves_selected_model_and_effort -- --nocapture — 1 passed.
  • After integration: CARGO_TARGET_DIR=<shared-target> cargo test --manifest-path src-tauri/Cargo.toml --lib agent_sessions::cli:: -- --nocapture — 458 passed, 4 ignored, 0 failed. Full workspace tests and a new packaged UI run were not repeated; new-head CI must run after push.
  • Current installed claude --help advertises --effort. ORG2's ClaudeCode command builder passes --model and --effort for both fresh and resumed turns.
  • Read-only inspection of the installed Claude App archive reconfirmed the UUID-only resume handler, effort omission during first adoption, and the separate setEffort runtime operation. No vendor files were modified.
  • Read back the retained test transcript: the successful ORG2 continuation at 15:00:03 UTC and Claude App continuation at 15:00:56 UTC on 2026-09-09 both record claude-fable-5-1 and effort=high. No new model turn or App restart was performed for this revalidation.
  • No UI layout changes; screenshot evidence would not prove the serialization boundary. Complete first-import effort inheritance remains unverified and previously failed its display check.

Architecture review covered parser reuse and visibility, separate CLI/runtime/catalog meanings, absent-override behavior, provider boundary, serialized fields, and loaded-versus-first-import initialization asymmetry. Compilation validation is recorded below; unrelated structural cleanup was excluded. Performance: no new background owner or retained state; no full lifecycle performance certification is claimed.

@Neonforge98
Neonforge98 force-pushed the codex/fix-claude-desktop-effort branch from e4567a9 to 9772324 Compare September 9, 2026 16:03
@Neonforge98 Neonforge98 changed the title fix(claude): preserve effort when publishing Desktop sessions fix(claude): serialize model and effort in App session metadata Sep 9, 2026
@Neonforge98 Neonforge98 closed this Sep 9, 2026
@Harry19081 Harry19081 added bug Something isn't working agent Agent runtime, behavior, memory, providers, or orchestration labels Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Agent runtime, behavior, memory, providers, or orchestration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants