-
-
Notifications
You must be signed in to change notification settings - Fork 371
feat(workspace): reuse checkout opens and trim repeated bootstrap #125
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
Open
Waishnav
wants to merge
9
commits into
main
Choose a base branch
from
feat/reuse-chatgpt-workspaces
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
866d49e
feat(workspace): reuse opens within ChatGPT sessions
Waishnav ff9c337
fix(workspace): keep reused cards visually stable
Waishnav 8ea171f
fix(review): restore checkpoints after restart
Waishnav e2121b4
fix(ui): expose workspace card metadata
Waishnav 44c0969
test(workspace): make reuse assertions deterministic
Waishnav f7fc11b
test(ui): remove duplicate workspace assertions
Waishnav fef5250
feat(workspace): track project bootstrap delivery
Waishnav 540d51c
fix(workspace): always create requested worktrees
Waishnav f5ab680
fix(server): separate workspace reuse from bootstrap
Waishnav 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
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,26 @@ | ||
| import assert from "node:assert/strict"; | ||
| import { openAiConversationScopeHash } from "./request-meta.js"; | ||
|
|
||
| assert.equal(openAiConversationScopeHash(undefined), undefined); | ||
| assert.equal(openAiConversationScopeHash({}), undefined); | ||
| assert.equal(openAiConversationScopeHash({ "openai/session": "" }), undefined); | ||
|
|
||
| const sessionOnly = openAiConversationScopeHash({ "openai/session": "chat-1" }); | ||
| assert.match(sessionOnly ?? "", /^[a-f0-9]{64}$/); | ||
| assert.equal( | ||
| sessionOnly, | ||
| openAiConversationScopeHash({ "openai/session": "chat-1" }), | ||
| ); | ||
| assert.notEqual( | ||
| sessionOnly, | ||
| openAiConversationScopeHash({ "openai/session": "chat-2" }), | ||
| ); | ||
|
|
||
| assert.equal( | ||
| sessionOnly, | ||
| openAiConversationScopeHash({ | ||
| "openai/session": "chat-1", | ||
| "openai/subject": "user-1", | ||
| "openai/organization": "org-1", | ||
| }), | ||
| ); |
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,20 @@ | ||
| import { createHash } from "node:crypto"; | ||
|
|
||
| function metadataString( | ||
| meta: Record<string, unknown> | undefined, | ||
| key: string, | ||
| ): string | undefined { | ||
| const value = meta?.[key]; | ||
| return typeof value === "string" && value.length > 0 ? value : undefined; | ||
| } | ||
|
|
||
| export function openAiConversationScopeHash( | ||
| meta: Record<string, unknown> | undefined, | ||
| ): string | undefined { | ||
| const session = metadataString(meta, "openai/session"); | ||
| if (!session) return undefined; | ||
|
|
||
| return createHash("sha256") | ||
| .update(JSON.stringify(["openai", session])) | ||
| .digest("hex"); | ||
| } |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Align the reopening conditions with
open_workspace.src/server.tsallows reopening when the user asks to reopen and when the model switches to a different folder or worktree. This document omits both cases. Restore them so the workflow does not reject valid user requests.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents