fix(slides): unbreak handle_folder_pick, collapse generator.rs to single builder path, port first_slide field #56
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_mik"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the hero_slides_server compile break on
origin/development(duplicatehandle_folder_pickleft by the7c3c42amerge), simplifies the image-generation path per the "not clean" feedback, and ports thefirst_slidefield fromdevelopment_kristof.Why this is needed
origin/developmentdoes not currently compile forhero_slides_server:The
7c3c42amerge brought together two sources that both definedfolder.pick:808c4f5(consultshero_procsecretfolder_pick_allowed_rootsin contexthero_slides, falls back to~/Documents) — the D-09-aligned keeper.$HOMEplaceholder from PR #55 — superseded.Fix: drop the sync placeholder,
.awaitthe async caller.Generator.rs refactor — single builder path
Three former branches (text-only / multimodal / fallback) all hit
ai.chatupstream —herolib_ai::generate_image_withroutes any call withaspect_ratio+image_sizeset through the same chat path (hero_lib/crates/ai/src/client.rs:505). The builder is the superset; zero attachments degenerates to a plain text request.Prompt framing stays conditional on attachment count so we don't tell the model "images attached" when none are present.
Matches the OpenRouter image-generation flow (chat-completions with
images[]response).Ported from
development_kristoffb3b622first_slide: Option<String>onDeckInfo—discovery.rspopulates it from the first slide with a generated PNG; serialized intodeck.list+deck_summary_valuefor UI thumbnail display.--infoJSON cleanup —hero_slidesCLI binds no sockets, drop therpc.sockentry;hero_slides_adminonly bindsadmin.sock, drop the stalerpc.sockentry.Skipped from
fb3b622: the duplicaterpc.rscollection-handler block (already ondevelopmentvia #48/#50/#52/#53/#55); the narrowerdependencies: ["hero_db_server"](HEAD already has the more accurate["hero_db_server", "hero_aibroker_server"]); the Cargo.toml dep pins (already ondevelopmentvia1122aa7).Skipped from
development_casper: stale WIP, fully superseded.Verification — end-to-end locally
hero_slides_servercompiles + starts cleanfolder.pickreturns~/Documentsfallback (allowlist secret unset on local)slide.generatevia CLI on04_sachaproduced 4.8 MB PNG (2752×1536) in 20 s via Gemini Flash Image / OpenRouterslide.getStalenessreturnsis_stale=falsepost-generate; firescontent_edited=trueon subsequent.mdedit (ADR-0007 closed loop intact)deck.listJSON now carriesfirst_slidefor both example decks (01_titleforhero_slides_intro,01_introforsample_deck)Diff stat
6 files, +110 / -177. Net code reduction from the generator.rs collapse.
Signed-off-by: mik-tf
Closing as superseded by upstream: despiegk pushed
a83ffff(folder.pick async fix) and3b89ec2(generator.rs collapse) on origin/development while this PR was open, covering the same scope. Will follow up with a smaller PR for the still-unique parts (first_slide field on DeckInfo + --info JSON cleanup).Pull request closed