Bug fixes and stability improvements (#815)

* fix(copilot): correct tool.execution_complete event handling

The CopilotProvider was using incorrect event type and data structure
for tool execution completion events from the @github/copilot-sdk,
causing tool call outputs to be empty.

Changes:
- Update event type from 'tool.execution_end' to 'tool.execution_complete'
- Fix data structure to use nested result.content instead of flat result
- Fix error structure to use error.message instead of flat error
- Add success field to match SDK event structure
- Add tests for empty and missing result handling

This aligns with the official @github/copilot-sdk v0.1.16 types
defined in session-events.d.ts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test(copilot): add edge case test for error with code field

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor(copilot): improve error handling and code quality

Code review improvements:
- Extract magic string '[ERROR]' to TOOL_ERROR_PREFIX constant
- Add null-safe error handling with direct error variable assignment
- Include error codes in error messages for better debugging
- Add JSDoc documentation for tool.execution_complete handler
- Update tests to verify error codes are displayed
- Add missing tool_use_id assertion in error test

These changes improve:
- Code maintainability (no magic strings)
- Debugging experience (error codes now visible)
- Type safety (explicit null checks)
- Test coverage (verify error code formatting)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Changes from fix/bug-fixes-1-0

* test(copilot): add edge case test for error with code field

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Changes from fix/bug-fixes-1-0

* fix: Handle detached HEAD state in worktree discovery and recovery

* fix: Remove unused isDevServerStarting prop and md: breakpoint classes

* fix: Add missing dependency and sanitize persisted cache data

* feat: Ensure NODE_ENV is set to test in vitest configs

* feat: Configure Playwright to run only E2E tests

* fix: Improve PR tracking and dev server lifecycle management

* feat: Add settings-based defaults for planning mode, model config, and custom providers. Fixes #816

* feat: Add worktree and branch selector to graph view

* fix: Add timeout and error handling for worktree HEAD ref resolution

* fix: use absolute icon path and place icon outside asar on Linux

The hicolor icon theme index only lists sizes up to 512x512, so an icon
installed only at 1024x1024 is invisible to GNOME/KDE's theme resolver,
causing both the app launcher and taskbar to show a generic icon.
Additionally, BrowserWindow.icon cannot be read by the window manager
when the file is inside app.asar.

- extraResources: copy logo_larger.png to resources/ (outside asar) so
  it lands at /opt/Automaker/resources/logo_larger.png on install
- linux.desktop.Icon: set to the absolute resources path, bypassing the
  hicolor theme lookup and its size constraints entirely
- icon-manager.ts: on Linux production use process.resourcesPath so
  BrowserWindow receives a real filesystem path the WM can read directly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: use linux.desktop.entry for custom desktop Icon field

electron-builder v26 rejects arbitrary keys in linux.desktop — the
correct schema wraps custom .desktop overrides inside desktop.entry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: set desktop name on Linux so taskbar uses the correct app icon

Without app.setDesktopName(), the window manager cannot associate the
running Electron process with automaker.desktop. GNOME/KDE fall back to
_NET_WM_ICON which defaults to Electron's own bundled icon.

Calling app.setDesktopName('automaker.desktop') before any window is
created sets the _GTK_APPLICATION_ID hint and XDG app_id so the WM
picks up the desktop entry's Icon for the taskbar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix: memory and context views mobile friendly (#818)

* Changes from fix/memory-and-context-mobile-friendly

* fix: Improve file extension detection and add path traversal protection

* refactor: Extract file extension utilities and add path traversal guards

Code review improvements:
- Extract isMarkdownFilename and isImageFilename to shared image-utils.ts
- Remove duplicated code from context-view.tsx and memory-view.tsx
- Add path traversal guard for context fixture utilities (matching memory)
- Add 7 new tests for context fixture path traversal protection
- Total 61 tests pass

Addresses code review feedback from PR #813

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: Add e2e tests for profiles crud and board background persistence

* Update apps/ui/playwright.config.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: Add robust test navigation handling and file filtering

* fix: Format NODE_OPTIONS configuration on single line

* test: Update profiles and board background persistence tests

* test: Replace iPhone 13 Pro with Pixel 5 for mobile test consistency

* Update apps/ui/src/components/views/context-view.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore: Remove test project directory

* feat: Filter context files by type and improve mobile menu visibility

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: Improve test reliability and localhost handling

* chore: Use explicit TEST_USE_EXTERNAL_BACKEND env var for server cleanup

* feat: Add E2E/CI mock mode for provider factory and auth verification

* feat: Add remoteBranch parameter to pull and rebase operations

* chore: Enhance E2E testing setup with worker isolation and auth state management

- Updated .gitignore to include worker-specific test fixtures.
- Modified e2e-tests.yml to implement test sharding for improved CI performance.
- Refactored global setup to authenticate once and save session state for reuse across tests.
- Introduced worker-isolated fixture paths to prevent conflicts during parallel test execution.
- Improved test navigation and loading handling for better reliability.
- Updated various test files to utilize new auth state management and fixture paths.

* fix: Update Playwright configuration and improve test reliability

- Increased the number of workers in Playwright configuration for better parallelism in CI environments.
- Enhanced the board background persistence test to ensure dropdown stability by waiting for the list to populate before interaction, improving test reliability.

* chore: Simplify E2E test configuration and enhance mock implementations

- Updated e2e-tests.yml to run tests in a single shard for streamlined CI execution.
- Enhanced unit tests for worktree list handling by introducing a mock for execGitCommand, improving test reliability and coverage.
- Refactored setup functions to better manage command mocks for git operations in tests.
- Improved error handling in mkdirSafe function to account for undefined stats in certain environments.

* refactor: Improve test configurations and enhance error handling

- Updated Playwright configuration to clear VITE_SERVER_URL, ensuring the frontend uses the Vite proxy and preventing cookie domain mismatches.
- Enhanced MergeRebaseDialog logic to normalize selectedBranch for better handling of various ref formats.
- Improved global setup with a more robust backend health check, throwing an error if the backend is not healthy after retries.
- Refactored project creation tests to handle file existence checks more reliably.
- Added error handling for missing E2E source fixtures to guide setup process.
- Enhanced memory navigation to handle sandbox dialog visibility more effectively.

* refactor: Enhance Git command execution and improve test configurations

- Updated Git command execution to merge environment paths correctly, ensuring proper command execution context.
- Refactored the Git initialization process to handle errors more gracefully and ensure user configuration is set before creating the initial commit.
- Improved test configurations by updating Playwright test identifiers for better clarity and consistency across different project states.
- Enhanced cleanup functions in tests to handle directory removal more robustly, preventing errors during test execution.

* fix: Resolve React hooks errors from duplicate instances in dependency tree

* style: Format alias configuration for improved readability

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: DhanushSantosh <dhanushsantoshs05@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
gsxdsm
2026-02-27 17:03:29 -08:00
parent 25f43f79fa
commit cce0a341b5
234 changed files with 15881 additions and 2916 deletions

View File

@@ -24,16 +24,11 @@ import {
import { Play, Cpu, FolderKanban, Settings2 } from 'lucide-react';
import { useNavigate } from '@tanstack/react-router';
import { toast } from 'sonner';
import { cn } from '@/lib/utils';
import { modelSupportsThinking } from '@/lib/utils';
import { cn, normalizeModelEntry } from '@/lib/utils';
import { useAppStore } from '@/store/app-store';
import type { ThinkingLevel, PlanningMode, Feature, FeatureImage } from '@/store/types';
import type { ReasoningEffort, PhaseModelEntry, AgentModel } from '@automaker/types';
import {
supportsReasoningEffort,
normalizeThinkingLevelForModel,
getThinkingLevelsForModel,
} from '@automaker/types';
import { normalizeThinkingLevelForModel, getThinkingLevelsForModel } from '@automaker/types';
import {
PrioritySelector,
WorkModeSelector,
@@ -90,6 +85,7 @@ type FeatureData = {
model: AgentModel;
thinkingLevel: ThinkingLevel;
reasoningEffort: ReasoningEffort;
providerId?: string;
branchName: string;
priority: number;
planningMode: PlanningMode;
@@ -327,13 +323,7 @@ export function AddFeatureDialog({
}
const finalCategory = category || 'Uncategorized';
const selectedModel = modelEntry.model;
const normalizedThinking = modelSupportsThinking(selectedModel)
? modelEntry.thinkingLevel || 'none'
: 'none';
const normalizedReasoning = supportsReasoningEffort(selectedModel)
? modelEntry.reasoningEffort || 'none'
: 'none';
const normalizedEntry = normalizeModelEntry(modelEntry);
// For 'current' mode, use empty string (work on current branch)
// For 'auto' mode, use empty string (will be auto-generated in use-board-actions)
@@ -381,9 +371,10 @@ export function AddFeatureDialog({
imagePaths,
textFilePaths,
skipTests,
model: selectedModel,
thinkingLevel: normalizedThinking,
reasoningEffort: normalizedReasoning,
model: normalizedEntry.model,
thinkingLevel: normalizedEntry.thinkingLevel,
reasoningEffort: normalizedEntry.reasoningEffort,
providerId: normalizedEntry.providerId,
branchName: finalBranchName,
priority,
planningMode,

View File

@@ -0,0 +1,41 @@
/**
* Constants for AgentOutputModal component
* Centralizes magic numbers, timeouts, and configuration values
*/
export const MODAL_CONSTANTS = {
// Auto-scroll threshold for detecting when user is at bottom
AUTOSCROLL_THRESHOLD: 50,
// Delay for closing modal after successful completion
MODAL_CLOSE_DELAY_MS: 1500,
// Modal height constraints for different viewports
HEIGHT_CONSTRAINTS: {
MOBILE_MAX_DVH: '85dvh',
SMALL_MAX_VH: '80vh',
TABLET_MAX_VH: '85vh',
},
// Modal width constraints for different viewports
WIDTH_CONSTRAINTS: {
MOBILE_MAX_CALC: 'calc(100% - 2rem)',
SMALL_MAX_VW: '60vw',
TABLET_MAX_VW: '90vw',
TABLET_MAX_WIDTH: '1200px',
},
// View modes
VIEW_MODES: {
SUMMARY: 'summary',
PARSED: 'parsed',
RAW: 'raw',
CHANGES: 'changes',
} as const,
// Component heights (complete Tailwind class fragments for template interpolation)
COMPONENT_HEIGHTS: {
SMALL_MIN: 'sm:min-h-[200px]',
SMALL_MAX: 'sm:max-h-[60vh]',
},
} as const;

View File

@@ -26,6 +26,7 @@ import { useAgentOutput, useFeature } from '@/hooks/queries';
import { cn } from '@/lib/utils';
import type { AutoModeEvent } from '@/types/electron';
import type { BacklogPlanEvent } from '@automaker/types';
import { MODAL_CONSTANTS } from './agent-output-modal.constants';
interface AgentOutputModalProps {
open: boolean;
@@ -257,7 +258,8 @@ export function AgentOutputModal({
if (!summaryScrollRef.current) return;
const { scrollTop, scrollHeight, clientHeight } = summaryScrollRef.current;
const isAtBottom = scrollHeight - scrollTop - clientHeight < 50;
const isAtBottom =
scrollHeight - scrollTop - clientHeight < MODAL_CONSTANTS.AUTOSCROLL_THRESHOLD;
setSummaryAutoScroll(isAtBottom);
};
@@ -440,7 +442,7 @@ export function AgentOutputModal({
return () => {
unsubscribe();
};
}, [open, featureId, isBacklogPlan]);
}, [open, featureId, isBacklogPlan, onClose]);
// Listen to backlog plan events and update output
useEffect(() => {

View File

@@ -140,6 +140,7 @@ export function BacklogPlanDialog({
setPrompt('');
onClose();
}, [
logger,
projectPath,
prompt,
modelOverride,

View File

@@ -24,10 +24,9 @@ import {
import { GitBranch, Cpu, FolderKanban, Settings2 } from 'lucide-react';
import { useNavigate } from '@tanstack/react-router';
import { toast } from 'sonner';
import { cn, modelSupportsThinking } from '@/lib/utils';
import { cn, migrateModelId, normalizeModelEntry } from '@/lib/utils';
import { Feature, ModelAlias, ThinkingLevel, PlanningMode } from '@/store/app-store';
import type { ReasoningEffort, PhaseModelEntry, DescriptionHistoryEntry } from '@automaker/types';
import { migrateModelId } from '@automaker/types';
import {
PrioritySelector,
WorkModeSelector,
@@ -41,7 +40,6 @@ import type { WorkMode } from '../shared';
import { PhaseModelSelector } from '@/components/views/settings-view/model-defaults/phase-model-selector';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
import { DependencyTreeDialog } from './dependency-tree-dialog';
import { supportsReasoningEffort } from '@automaker/types';
interface EditFeatureDialogProps {
feature: Feature | null;
@@ -56,6 +54,7 @@ interface EditFeatureDialogProps {
model: ModelAlias;
thinkingLevel: ThinkingLevel;
reasoningEffort: ReasoningEffort;
providerId?: string;
imagePaths: DescriptionImagePath[];
textFilePaths: DescriptionTextFilePath[];
branchName: string; // Can be empty string to use current branch
@@ -109,11 +108,14 @@ export function EditFeatureDialog({
);
// Model selection state - migrate legacy model IDs to canonical format
const [modelEntry, setModelEntry] = useState<PhaseModelEntry>(() => ({
model: migrateModelId(feature?.model) || 'claude-opus',
thinkingLevel: feature?.thinkingLevel || 'none',
reasoningEffort: feature?.reasoningEffort || 'none',
}));
const [modelEntry, setModelEntry] = useState<PhaseModelEntry>(() =>
normalizeModelEntry({
model: migrateModelId(feature?.model) || 'claude-opus',
thinkingLevel: feature?.thinkingLevel || 'none',
reasoningEffort: feature?.reasoningEffort || 'none',
providerId: feature?.providerId,
})
);
// Track the source of description changes for history
const [descriptionChangeSource, setDescriptionChangeSource] = useState<
@@ -161,11 +163,14 @@ export function EditFeatureDialog({
setPreEnhancementDescription(null);
setLocalHistory(feature.descriptionHistory ?? []);
// Reset model entry - migrate legacy model IDs
setModelEntry({
model: migrateModelId(feature.model) || 'claude-opus',
thinkingLevel: feature.thinkingLevel || 'none',
reasoningEffort: feature.reasoningEffort || 'none',
});
setModelEntry(
normalizeModelEntry({
model: migrateModelId(feature.model) || 'claude-opus',
thinkingLevel: feature.thinkingLevel || 'none',
reasoningEffort: feature.reasoningEffort || 'none',
providerId: feature.providerId,
})
);
// Reset dependency state
setParentDependencies(feature.dependencies ?? []);
const childDeps = allFeatures
@@ -202,19 +207,14 @@ export function EditFeatureDialog({
if (!editingFeature) return;
// Validate branch selection for custom mode
const isBranchSelectorEnabled = editingFeature.status === 'backlog';
const isBranchSelectorEnabled =
editingFeature.status === 'backlog' || editingFeature.status === 'merge_conflict';
if (isBranchSelectorEnabled && workMode === 'custom' && !editingFeature.branchName?.trim()) {
toast.error('Please select a branch name');
return;
}
const selectedModel = modelEntry.model;
const normalizedThinking: ThinkingLevel = modelSupportsThinking(selectedModel)
? (modelEntry.thinkingLevel ?? 'none')
: 'none';
const normalizedReasoning: ReasoningEffort = supportsReasoningEffort(selectedModel)
? (modelEntry.reasoningEffort ?? 'none')
: 'none';
const normalizedEntry = normalizeModelEntry(modelEntry);
// For 'current' mode, use empty string (work on current branch)
// For 'auto' mode, use empty string (will be auto-generated in use-board-actions)
@@ -232,9 +232,10 @@ export function EditFeatureDialog({
category: editingFeature.category,
description: editingFeature.description,
skipTests: editingFeature.skipTests ?? false,
model: selectedModel,
thinkingLevel: normalizedThinking,
reasoningEffort: normalizedReasoning,
model: normalizedEntry.model,
thinkingLevel: normalizedEntry.thinkingLevel,
reasoningEffort: normalizedEntry.reasoningEffort,
providerId: normalizedEntry.providerId,
imagePaths: editingFeature.imagePaths ?? [],
textFilePaths: editingFeature.textFilePaths ?? [],
branchName: finalBranchName,
@@ -557,7 +558,9 @@ export function EditFeatureDialog({
branchSuggestions={branchSuggestions}
branchCardCounts={branchCardCounts}
currentBranch={currentBranch}
disabled={editingFeature.status !== 'backlog'}
disabled={
editingFeature.status !== 'backlog' && editingFeature.status !== 'merge_conflict'
}
testIdPrefix="edit-feature-work-mode"
/>
</div>
@@ -627,7 +630,8 @@ export function EditFeatureDialog({
hotkeyActive={!!editingFeature}
data-testid="confirm-edit-feature"
disabled={
editingFeature.status === 'backlog' &&
(editingFeature.status === 'backlog' ||
editingFeature.status === 'merge_conflict') &&
workMode === 'custom' &&
!editingFeature.branchName?.trim()
}

View File

@@ -0,0 +1,138 @@
/**
* Event content formatting utilities for AgentOutputModal
* Extracts the complex switch statement logic from the main component
*/
import type { AutoModeEvent } from '@/types/electron';
import type { BacklogPlanEvent } from '@automaker/types';
/**
* Format auto mode event content for display
*/
export function formatAutoModeEventContent(event: AutoModeEvent): string {
switch (event.type) {
case 'auto_mode_progress':
return event.content || '';
case 'auto_mode_tool': {
const toolName = event.tool || 'Unknown Tool';
const toolInput = event.input ? JSON.stringify(event.input, null, 2) : '';
return `\n🔧 Tool: ${toolName}\n${toolInput ? `Input: ${toolInput}\n` : ''}`;
}
case 'auto_mode_phase': {
const phaseEmoji = event.phase === 'planning' ? '📋' : event.phase === 'action' ? '⚡' : '✅';
return `\n${phaseEmoji} ${event.message}\n`;
}
case 'auto_mode_error':
return `\n❌ Error: ${event.error}\n`;
case 'auto_mode_ultrathink_preparation':
return formatUltrathinkPreparation(event);
case 'planning_started': {
if ('mode' in event && 'message' in event) {
const modeLabel = event.mode === 'lite' ? 'Lite' : event.mode === 'spec' ? 'Spec' : 'Full';
return `\n📋 Planning Mode: ${modeLabel}\n${event.message}\n`;
}
return '';
}
case 'plan_approval_required':
return '\n⏸ Plan generated - waiting for your approval...\n';
case 'plan_approved':
return event.hasEdits
? '\n✅ Plan approved (with edits) - continuing to implementation...\n'
: '\n✅ Plan approved - continuing to implementation...\n';
case 'plan_auto_approved':
return '\n✅ Plan auto-approved - continuing to implementation...\n';
case 'plan_revision_requested': {
const revisionEvent = event as Extract<AutoModeEvent, { type: 'plan_revision_requested' }>;
return `\n🔄 Revising plan based on your feedback (v${revisionEvent.planVersion})...\n`;
}
case 'auto_mode_task_started': {
const taskEvent = event as Extract<AutoModeEvent, { type: 'auto_mode_task_started' }>;
return `\n▶ Starting ${taskEvent.taskId}: ${taskEvent.taskDescription}\n`;
}
case 'auto_mode_task_complete': {
const taskEvent = event as Extract<AutoModeEvent, { type: 'auto_mode_task_complete' }>;
return `\n✓ ${taskEvent.taskId} completed (${taskEvent.tasksCompleted}/${taskEvent.tasksTotal})\n`;
}
case 'auto_mode_phase_complete': {
const phaseEvent = event as Extract<AutoModeEvent, { type: 'auto_mode_phase_complete' }>;
return `\n🏁 Phase ${phaseEvent.phaseNumber} complete\n`;
}
case 'auto_mode_feature_complete': {
const emoji = event.passes ? '✅' : '⚠️';
return `\n${emoji} Task completed: ${event.message}\n`;
}
default:
return '';
}
}
/**
* Format backlog plan event content for display
*/
export function formatBacklogPlanEventContent(event: BacklogPlanEvent): string {
switch (event.type) {
case 'backlog_plan_progress':
return `\n🧭 ${event.content || 'Backlog plan progress update'}\n`;
case 'backlog_plan_error':
return `\n❌ Backlog plan error: ${event.error || 'Unknown error'}\n`;
case 'backlog_plan_complete':
return '\n✅ Backlog plan completed\n';
default:
return `\n ${event.type}\n`;
}
}
/**
* Format ultrathink preparation details
*/
function formatUltrathinkPreparation(
event: AutoModeEvent & {
warnings?: string[];
recommendations?: string[];
estimatedCost?: number;
estimatedTime?: string;
}
): string {
let prepContent = '\n🧠 Ultrathink Preparation\n';
if (event.warnings && event.warnings.length > 0) {
prepContent += '\n⚠ Warnings:\n';
event.warnings.forEach((warning: string) => {
prepContent += `${warning}\n`;
});
}
if (event.recommendations && event.recommendations.length > 0) {
prepContent += '\n💡 Recommendations:\n';
event.recommendations.forEach((rec: string) => {
prepContent += `${rec}\n`;
});
}
if (event.estimatedCost !== undefined) {
prepContent += `\n💰 Estimated Cost: ~$${event.estimatedCost.toFixed(2)} per execution\n`;
}
if (event.estimatedTime) {
prepContent += `\n⏱ Estimated Time: ${event.estimatedTime}\n`;
}
return prepContent;
}

View File

@@ -22,7 +22,7 @@ import {
import type { WorkMode } from '../shared';
import { PhaseModelSelector } from '@/components/views/settings-view/model-defaults/phase-model-selector';
import type { PhaseModelEntry } from '@automaker/types';
import { cn } from '@/lib/utils';
import { cn, normalizeModelEntry } from '@/lib/utils';
interface MassEditDialogProps {
open: boolean;
@@ -181,7 +181,9 @@ export function MassEditDialog({
});
setModel(getInitialValue(selectedFeatures, 'model', 'claude-sonnet') as ModelAlias);
setThinkingLevel(getInitialValue(selectedFeatures, 'thinkingLevel', 'none') as ThinkingLevel);
setProviderId(undefined); // Features don't store providerId, but we track it after selection
setProviderId(
getInitialValue(selectedFeatures, 'providerId', undefined) as string | undefined
);
setPlanningMode(getInitialValue(selectedFeatures, 'planningMode', 'skip') as PlanningMode);
setRequirePlanApproval(getInitialValue(selectedFeatures, 'requirePlanApproval', false));
setPriority(getInitialValue(selectedFeatures, 'priority', 2));
@@ -207,8 +209,23 @@ export function MassEditDialog({
const handleApply = async () => {
const updates: Partial<Feature> = {};
if (applyState.model) updates.model = model;
if (applyState.thinkingLevel) updates.thinkingLevel = thinkingLevel;
if (applyState.model || applyState.thinkingLevel) {
const normalizedEntry = normalizeModelEntry({
model,
thinkingLevel,
providerId,
});
if (applyState.model) {
updates.model = normalizedEntry.model;
updates.providerId = normalizedEntry.providerId;
}
if (applyState.thinkingLevel) {
updates.thinkingLevel = normalizedEntry.thinkingLevel;
}
}
if (applyState.planningMode) updates.planningMode = planningMode;
if (applyState.requirePlanApproval) updates.requirePlanApproval = requirePlanApproval;
if (applyState.priority) updates.priority = priority;

View File

@@ -192,15 +192,9 @@ export function MergeRebaseDialog({
const api = getHttpApiClient();
if (selectedStrategy === 'rebase') {
// First fetch the remote to ensure we have latest refs
try {
await api.worktree.pull(worktree.path, selectedRemote);
} catch {
// Fetch may fail if no upstream - that's okay, we'll try rebase anyway
}
// Attempt the rebase operation
const result = await api.worktree.rebase(worktree.path, selectedBranch);
// Attempt the rebase operation - the rebase service fetches from the remote
// before rebasing to ensure we have up-to-date refs
const result = await api.worktree.rebase(worktree.path, selectedBranch, selectedRemote);
if (result.success) {
toast.success(`Rebased onto ${selectedBranch}`, {
@@ -223,9 +217,26 @@ export function MergeRebaseDialog({
setStep('select');
}
} else {
// Merge strategy - attempt to merge the remote branch
// Use the pull endpoint for merging remote branches
const result = await api.worktree.pull(worktree.path, selectedRemote, true);
// Merge strategy - merge the selected remote branch into the current branch.
// selectedBranch may be a full ref (e.g. refs/remotes/origin/main); normalize to short name
// for 'git pull <remote> <branch>'.
let remoteBranchShortName = selectedBranch;
const remotePrefix = `refs/remotes/${selectedRemote}/`;
if (selectedBranch.startsWith(remotePrefix)) {
remoteBranchShortName = selectedBranch.slice(remotePrefix.length);
} else if (selectedBranch.startsWith(`${selectedRemote}/`)) {
remoteBranchShortName = selectedBranch.slice(selectedRemote.length + 1);
} else if (selectedBranch.startsWith('refs/heads/')) {
remoteBranchShortName = selectedBranch.slice('refs/heads/'.length);
} else if (selectedBranch.startsWith('refs/')) {
remoteBranchShortName = selectedBranch.slice('refs/'.length);
}
const result = await api.worktree.pull(
worktree.path,
selectedRemote,
true,
remoteBranchShortName
);
if (result.success && result.result) {
if (result.result.hasConflicts) {

View File

@@ -510,9 +510,12 @@ export function StashChangesDialog({
A descriptive message helps identify this stash later. Press{' '}
<kbd className="px-1 py-0.5 text-[10px] bg-muted rounded border">
{typeof navigator !== 'undefined' &&
((navigator as any).userAgentData?.platform || navigator.platform || '').includes(
'Mac'
)
(
(navigator as Navigator & { userAgentData?: { platform?: string } }).userAgentData
?.platform ||
navigator.platform ||
''
).includes('Mac')
? '⌘'
: 'Ctrl'}
+Enter