Conversation
Each terminal session now independently tracks its active conversation. Two tabs in the same workspace can run queries simultaneously without interfering with each other. Session identity is resolved automatically: `getsid(0)` on Unix, `GetConsoleWindow()` on Windows, terminal env vars (`$TMUX_PANE`, `$WEZTERM_PANE`, etc.) as fallback, with `$JP_SESSION` for explicit override. Mappings are stored in user-local data so each session's state persists across invocations. Conversations are protected by OS-level advisory locks (`flock` on Unix, `LockFileEx` on Windows) for the duration of a `jp query`. When a lock is contended, the command polls up to 30 seconds (overridable via `$JP_LOCK_DURATION`) then shows an interactive prompt: - Continue waiting - Start a new conversation - Fork this conversation - Cancel The global "active conversation" concept is removed entirely. All conversation targeting is now session-scoped. New targeting keywords are available across all conversation commands: jp query --id last # most recently activated conversation jp query --id prev # session's previous conversation jp query --id <id> # specific conversation jp query --id # interactive picker jp query --fork # fork the session's active conversation jp query --fork=2 # fork keeping last 2 turns A `conversation.default_id` config field controls the fallback when no session mapping exists yet (default: `ask` — picker or error). The terminal title is updated via OSC 2 when a conversation is resolved and again when the title generator task completes, so each tab shows which conversation it is working on. Internally, the workspace API is rebuilt around `ConversationHandle` (proof of existence) and `ConversationLock` / `ConversationMut` (guard-scoped persistence, per RFD 069). Conversation data persists automatically on `ConversationMut` drop while the cross-process lock is held. `jp_tombmap` is removed in favor of `HashMap` + `OnceLock` + `Arc<RwLock>`. Config loading is refactored into a two-phase `ConfigPipeline`: static sources (files + env + `--cfg`) are resolved once, then optionally merged with per-conversation config, this allows the pre-startup phase to read the `conversation.default_id` config. Closes: #198 Signed-off-by: Jean Mertz <git@jeanmertz.com>
…acking Signed-off-by: Jean Mertz <git@jeanmertz.com>
…acking Signed-off-by: Jean Mertz <git@jeanmertz.com>
…acking Signed-off-by: Jean Mertz <git@jeanmertz.com>
…acking Signed-off-by: Jean Mertz <git@jeanmertz.com>
…acking 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.
See: https://jp.computer/rfd/020-parallel-conversations
Each terminal session now independently tracks its active conversation. Two tabs in the same workspace can run queries simultaneously without interfering with each other.
Session identity is resolved automatically:
getsid(0)on Unix,GetConsoleWindow()on Windows, terminal env vars ($TMUX_PANE,$WEZTERM_PANE, etc.) as fallback, with$JP_SESSIONfor explicit override. Mappings are stored in user-local data so each session's state persists across invocations.Conversations are protected by OS-level advisory locks (
flockon Unix,LockFileExon Windows) for the duration of ajp query. When a lock is contended, the command polls up to 30 seconds (overridable via$JP_LOCK_DURATION) then shows an interactive prompt:The global "active conversation" concept is removed entirely. All conversation targeting is now session-scoped.
New targeting keywords are available across all conversation commands:
A
conversation.default_idconfig field controls the fallback when no session mapping exists yet (default:ask— picker or error).The terminal title is updated via OSC 2 when a conversation is resolved and again when the title generator task completes, so each tab shows which conversation it is working on.
Internally, the workspace API is rebuilt around
ConversationHandle(proof of existence) andConversationLock/ConversationMut(guard-scoped persistence, per RFD 069). Conversation data persists automatically onConversationMutdrop while the cross-process lock is held.jp_tombmapis removed in favor ofHashMap+OnceLock+Arc<RwLock>. Config loading is refactored into a two-phaseConfigPipeline: static sources (files + env +--cfg) are resolved once, then optionally merged with per-conversation config, this allows the pre-startup phase to read theconversation.default_idconfig.Closes: #198