-
Notifications
You must be signed in to change notification settings - Fork 0
Align session fork ids with prompt cache hints #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
20f262e
Align session fork ids with prompt cache hints
riatzukiza 973404b
Fixed test logic by using null command text.
opencode-agent[bot] 4afc4df
Potential fix for pull request finding 'Useless assignment to local v…
riatzukiza 398bb13
Merge branch 'dev' into feat/align-session-fork-ids-23
riatzukiza 72db4d7
Fixed compaction test logic, all tests pass
opencode-agent[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Issue #23 – SessionManager fork alignment | ||
|
|
||
| ## Context | ||
|
|
||
| - Issue: https://github.com/open-hax/codex/issues/23 | ||
| - Follow-up to PR #20 CodeRabbit review discussion on `extractForkIdentifier`. | ||
| - Problem: `lib/session/session-manager.ts` uses fork hints limited to `forkId|fork_id|branchId|branch_id` (~lines 120-143). Prompt cache fork derivation in `lib/request/prompt-cache.ts` also accepts `parentConversationId|parent_conversation_id` (~lines 70-132). Requests that set only parent conversation IDs diverge: prompt cache key suffix includes fork hint, session key does not. | ||
|
|
||
| ## Affected areas | ||
|
|
||
| - `lib/session/session-manager.ts` (extract fork keys, session key construction) | ||
| - `lib/request/prompt-cache.ts` (source of fork hint keys) | ||
| - Tests: `test/session-manager.test.ts` (missing coverage for parent conversation fork hints) | ||
|
|
||
| ## Requirements / Definition of Done | ||
|
|
||
| - Session key and prompt cache key derivation use the same set of fork hint keys (including parent conversation IDs) so forks stay consistent regardless of hint field used. | ||
| - Normalize/trim behavior remains consistent with existing fork handling; no regressions for current fork/branch keys. | ||
| - Add/adjust tests to cover parent conversation fork hint path. | ||
| - Build/tests pass. | ||
|
|
||
| ## Plan (phases) | ||
|
|
||
| 1. Analysis: Confirm current fork key sources in session manager vs prompt cache; note normalization differences and existing tests. | ||
| 2. Design/Implementation: Share or mirror fork key list to include parent conversation IDs in session manager; keep trim behavior; ensure prompt cache alignment comments updated. Update session manager logic accordingly, adjusting helper if needed. | ||
| 3. Verification: Add/extend session manager tests for parent conversation fork hints and run relevant test subset (session manager + prompt cache if needed). | ||
|
|
||
| ## Changelog | ||
|
|
||
| - 2025-11-20: Exported prompt cache fork key list for reuse, aligned SessionManager fork extraction with parent conversation hints, and added session-manager tests covering parent conversation fork identifiers. |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.