## CHANGES

- NewInstanceModal now preserves SSH config during agent re-detection flows 🧭
- Tests now mock remote `fs.stat` to validate SSH working directory reliably 🧪
- NewInstanceModal tests wait for debounced remote path validation before creating ⏱️
- Leaderboard “Submit” button stays hidden after success to avoid resubmits 🚫
- Leaderboard “Sync from cloud” is now available even after successful submit 🔄
- Leaderboard “Opt Out” action remains accessible after a successful registration 🧾
- Autorun synopsis prompt bans session-context preambles for cleaner summaries ✍️
This commit is contained in:
Pedram Amini
2026-01-11 00:06:55 -06:00
parent 0fe46fb35d
commit fddea077ca
4 changed files with 21 additions and 4 deletions

View File

@@ -2315,6 +2315,14 @@ describe('NewInstanceModal', () => {
enabled: true,
}],
});
// Mock fs.stat for remote path validation
vi.mocked(window.maestro.fs.stat).mockResolvedValue({
size: 4096,
createdAt: '2024-01-01T00:00:00.000Z',
modifiedAt: '2024-01-15T12:30:00.000Z',
isDirectory: true,
isFile: false,
});
render(
<NewInstanceModal
@@ -2371,6 +2379,12 @@ describe('NewInstanceModal', () => {
const dirInput = screen.getByLabelText('Working Directory');
fireEvent.change(dirInput, { target: { value: '/test/path' } });
// Wait for remote path validation to complete (debounced 300ms)
// This validates the path exists on the remote and enables the Create button
await waitFor(() => {
expect(screen.getByText('Remote directory found')).toBeInTheDocument();
}, { timeout: 3000 });
// The core verification: clicking Create should pass the SSH config that was pending
const createButton = screen.getByText('Create Agent');
await act(async () => {

View File

@@ -7,4 +7,6 @@ Provide a brief synopsis of what you just accomplished in this task using this e
Rules:
- Be specific about what was actually accomplished, not what was attempted.
- Focus only on meaningful work that was done. Omit filler phrases like "the task is complete", "no further action needed", "everything is working", etc.
- NEVER include preamble about session context, interaction history, or caveats like "This is our first interaction", "there's no prior work to summarize", "you asked me to", etc. Jump straight to the accomplishment.
- Start directly with the action taken (e.g., "Fixed button visibility..." not "You asked me to fix...").
- If nothing meaningful was accomplished, respond with only: **Summary:** No changes made.

View File

@@ -1016,7 +1016,7 @@ export function LeaderboardRegistrationModal({
{/* Footer */}
<div className="p-4 border-t flex justify-center gap-3" style={{ borderColor: theme.colors.border }}>
{/* Push Up - Submit stats to leaderboard */}
{submitState !== 'success' && submitState !== 'awaiting_confirmation' && submitState !== 'polling' && submitState !== 'opted_out' && !showOptOutConfirm && (
{submitState !== 'awaiting_confirmation' && submitState !== 'polling' && submitState !== 'opted_out' && !showOptOutConfirm && (
<button
onClick={handleSubmit}
disabled={!isFormValid || submitState === 'submitting' || showManualTokenEntry}
@@ -1042,7 +1042,7 @@ export function LeaderboardRegistrationModal({
)}
{/* Pull Down - Sync from cloud (only for existing registrations with auth token) */}
{existingRegistration?.authToken && !showOptOutConfirm && (submitState === 'idle' || submitState === 'error') && onSyncStats && (
{existingRegistration?.authToken && !showOptOutConfirm && (submitState === 'idle' || submitState === 'error' || submitState === 'success') && onSyncStats && (
<button
onClick={handleSyncFromServer}
disabled={isSyncing}
@@ -1068,7 +1068,7 @@ export function LeaderboardRegistrationModal({
)}
{/* Opt Out */}
{existingRegistration && !showOptOutConfirm && submitState === 'idle' && (
{existingRegistration && !showOptOutConfirm && (submitState === 'idle' || submitState === 'success') && (
<button
onClick={() => setShowOptOutConfirm(true)}
className="px-4 py-2 text-sm rounded transition-colors flex items-center gap-2"

View File

@@ -243,7 +243,8 @@ export function NewInstanceModal({ isOpen, onClose, onCreate, theme, existingSes
// Per-agent config (path, args, env vars) starts empty - each agent gets its own config
// No provider-level loading - config is set per-agent during creation
// Only reset if NOT duplicating (source session will provide values)
if (!source) {
// Also preserve SSH configs when re-detecting (sshRemoteId is provided during re-detection)
if (!source && !sshRemoteId) {
setCustomAgentPaths({});
setCustomAgentArgs({});
setCustomAgentEnvVars({});