You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(profiles): a session started with --name skips the startup profile switch (session_info breaks the own-start check) #3417
I searched open and closed issues and did not find a report of this problem.
I reviewed this report and removed credentials, tokens, private paths, hostnames, and other sensitive data.
Problem
With a per-worktree profile declaration (.pi/gentle-ai/profile.json), a session launched with pi --name <label> never runs the startup profile switch: it keeps the default orchestrator model and shows no startup profile notice. Pi writes a session_info entry for --name before session_start (pi-coding-agentdist/main.js:626-632). isSessionOwnStart (extensions/gentle-ai.ts:7304-7313 in 4.9.0) counts that entry as earlier history and returns false, so startupProfile stays undefined and the switch block (around :12913) is skipped. It fails silently, because the reached block always notifies (:12932-12933). Related: #2862 (same "a fresh session has no entries" assumption in gentle-agents) and #2853 (own-start predicate).
Steps to reproduce
In a Git worktree, write .pi/gentle-ai/profile.json = {"kind":"gentle-pi.agent_model_profile_pin","version":1,"profile":"<name>"} for a profile whose orchestrator model differs from the current default.
Launch gentle-shell from that worktree with no other arguments: the status bar shows the profile's orchestrator model (observed: deepseek-v4-flash · high · nan (repo)).
Launch gentle-shell -- --name test from the same worktree: the status bar keeps the default model with the profile label (observed: claude-opus-5-5 · high · nan (repo)), and no startup profile notice is shown.
Workaround: also pass --model/--thinking matching the profile.
Expected and actual behavior
Expected: metadata-only entries such as session_info are ignored by the own-start test, so a named fresh session applies the declared profile like an unnamed one.
Actual: with --name, the declared profile's orchestrator model is silently not applied.
Fixed in #3584 and merged into main. I tested it with and without --name test, and both runs applied the worktree profile and showed the startup notice.
Activity
fix(profiles): apply startup profile to named sessions (#3584)
barbatdev commentedon Nov 27, 2026
Fixed in #3584 and merged into
main. I tested it with and without--name test, and both runs applied the worktree profile and showed the startup notice.Closing this as fixed.