• Will Chen's avatar
    fix: use current branch when creating new chat instead of hardcoding main (#2411) · 51c810ec
    Will Chen 提交于
    ## Summary
    - **Fixes #2396**: When creating a new chat (including "summarize to new
    chat"), the system was hardcoding `ref: "main"` when getting the
    `initialCommitHash`, causing issues when users work on feature branches
    - Changed to use the default `"HEAD"` ref instead, so the chat correctly
    tracks the currently checked-out branch's commit
    - This prevents merge conflicts and ensures changes are applied to the
    correct branch
    
    ## Test plan
    1. Create a feature branch from main
    2. Create a new chat while on the feature branch
    3. Verify the new chat tracks the feature branch's commit, not main's
    commit
    4. Test "summarize to new chat" functionality while on a feature branch
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    <!-- devin-review-badge-begin -->
    
    ---
    
    <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2411">
      <picture>
    <source media="(prefers-color-scheme: dark)"
    srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img
    src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
    alt="Open with Devin">
      </picture>
    </a>
    <!-- devin-review-badge-end -->
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > **Low Risk**
    > Low risk: a small, localized change that only affects which git ref is
    used to capture `initialCommitHash` during chat creation.
    > 
    > **Overview**
    > When creating a new chat, the `initialCommitHash` is now resolved from
    the repo’s current `HEAD` rather than forcing `ref: "main"`, so chats
    created on feature branches track the correct starting commit.
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    541b373218a04781d63dfdb05474b4f110d38ab0. This will update automatically
    on new commits. Configure
    [here](https://cursor.com/dashboard?tab=bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    New chats now use the currently checked-out branch (HEAD) to resolve
    initialCommitHash instead of hardcoding main. This ensures chats track
    the correct branch and prevents merge conflicts. Fixes #2396.
    
    <sup>Written for commit 541b373218a04781d63dfdb05474b4f110d38ab0.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    Co-authored-by: 's avatarClaude Opus 4.5 <noreply@anthropic.com>
    51c810ec
名称
最后提交
最后更新
..
app_env_vars_handlers.ts 正在载入提交数据...
app_handlers.ts 正在载入提交数据...
app_upgrade_handlers.ts 正在载入提交数据...
base.ts 正在载入提交数据...
capacitor_handlers.ts 正在载入提交数据...
chat_handlers.ts 正在载入提交数据...
chat_stream_handlers.ts 正在载入提交数据...
context_paths_handlers.ts 正在载入提交数据...
createFromTemplate.ts 正在载入提交数据...
debug_handlers.ts 正在载入提交数据...
dependency_handlers.ts 正在载入提交数据...
free_agent_quota_handlers.ts 正在载入提交数据...
git_branch_handlers.ts 正在载入提交数据...
github_handlers.ts 正在载入提交数据...
help_bot_handlers.ts 正在载入提交数据...
import_handlers.ts 正在载入提交数据...
language_model_handlers.ts 正在载入提交数据...
local_model_handlers.ts 正在载入提交数据...
local_model_lmstudio_handler.ts 正在载入提交数据...
local_model_ollama_handler.ts 正在载入提交数据...
mcp_handlers.ts 正在载入提交数据...
neon_handlers.ts 正在载入提交数据...
node_handlers.ts 正在载入提交数据...
portal_handlers.ts 正在载入提交数据...
pro_handlers.ts 正在载入提交数据...
problems_handlers.ts 正在载入提交数据...
prompt_handlers.ts 正在载入提交数据...
proposal_handlers.ts 正在载入提交数据...
release_note_handlers.ts 正在载入提交数据...
safe_handle.ts 正在载入提交数据...
security_handlers.ts 正在载入提交数据...
session_handlers.ts 正在载入提交数据...
settings_handlers.ts 正在载入提交数据...
shell_handler.ts 正在载入提交数据...
supabase_handlers.ts 正在载入提交数据...
template_handlers.ts 正在载入提交数据...
testing_chat_handlers.ts 正在载入提交数据...
token_count_handlers.ts 正在载入提交数据...
upload_handlers.ts 正在载入提交数据...
vercel_handlers.ts 正在载入提交数据...
version_handlers.ts 正在载入提交数据...
window_handlers.ts 正在载入提交数据...