Conversation
The role-header model id was being sourced from `ModelDetails.id` returned by the provider. Some providers rewrite the id — for example, Anthropic resolves an unversioned name to a date-suffixed canonical form. This caused the live turn header and the replay header to show different model strings for the same conversation. On replay, `TurnRenderer::reconfigure` reads the per-turn `PartialAppConfig` snapshot stored in the conversation, which always holds the *configured* id. Pinning the live path to the same source (`cfg.assistant.model.id.resolved()`) keeps both paths consistent and stable across API version drift. `TurnRenderer::reconfigure` is updated in the same direction: identity fields (assistant name and model id) are now read from the partial directly, before the full `AppConfig::from_partial_with_defaults` rebuild, so the role header never depends on default-filling for these two stable fields. A new `render_model_id` helper maps a fully-empty partial id to `None`, suppressing the `(model)` suffix from the header rather than showing an empty string. Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
When `jp` finishes its main work, it waits for background tasks (e.g. title generation) before exiting. Previously this was a silent, blocking call with no user feedback and no way to interrupt it. This commit replaces that with an interactive drain loop. If background tasks are still running after 1 second, a `⏱ Finishing background tasks… Ns` line is printed to stderr (TTY only). The first Ctrl+C (SIGINT/SIGTERM) switches the line to a 2-second countdown and signals graceful cancellation via the existing soft-cancel token. A second Ctrl+C — or SIGQUIT — escalates to a hard force-quit that aborts the `JoinSet` immediately and drops any pending workspace mutations. The escalation path required a second `force_token` on `TaskHandler`. The soft-cancel token already existed but was only fired internally; it is now also exposed via `cancel_token()` so the drain loop can signal it externally. `is_empty()` is added to short-circuit the whole drain when there is nothing to wait for. As a related fix, `TitleGeneratorTask` now accepts an `is_tty` flag and suppresses the OSC-2 terminal-title sequence when the process is not attached to a TTY. Without this guard, the escape bytes leaked into captured pipes or CI logs when running `jp` non-interactively. Signed-off-by: Jean Mertz <git@jeanmertz.com>
…scalation Signed-off-by: Jean Mertz <git@jeanmertz.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
jpfinishes its main work, it waits for background tasks (e.g. title generation) before exiting. Previously this was a silent, blocking call with no user feedback and no way to interrupt it.This commit replaces that with an interactive drain loop. If background tasks are still running after 1 second, a
⏱ Finishing background tasks… Nsline is printed to stderr (TTY only). The first Ctrl+C (SIGINT/SIGTERM) switches the line to a 2-second countdown and signals graceful cancellation via the existing soft-cancel token. A second Ctrl+C — or SIGQUIT — escalates to a hard force-quit that aborts theJoinSetimmediately and drops any pending workspace mutations.The escalation path required a second
force_tokenonTaskHandler. The soft-cancel token already existed but was only fired internally; it is now also exposed viacancel_token()so the drain loop can signal it externally.is_empty()is added to short-circuit the whole drain when there is nothing to wait for.As a related fix,
TitleGeneratorTasknow accepts anis_ttyflag and suppresses the OSC-2 terminal-title sequence when the process is not attached to a TTY. Without this guard, the escape bytes leaked into captured pipes or CI logs when runningjpnon-interactively.