Skip to content
This repository was archived by the owner on Aug 25, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/upstream-fix-batch-a.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"echadron": patch
---

More upstream reliability fixes: cancelling an MCP authorization no longer leaves the flow hanging until its timeout, `/feedback` now works for any signed-in user rather than only those running a managed model, a missing Git Bash on Windows reports what it looked for instead of a raw probe failure, web session export is no longer capped at 64 MiB, and a multi-select question in the VS Code panel waits for every answer.
17 changes: 12 additions & 5 deletions apps/kimi-code/src/feedback/feedback-attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,31 @@ async function prepareAndUploadCodebaseArchive(
* `produce` write the archive to it, upload it, then always remove the temp
* directory — even when `produce` or the upload throws. Both the session log
* archive and the codebase archive flow through here so their cleanup and
* error handling cannot drift apart.
* error handling cannot drift apart. Every failure — including archive-path
* creation — is contained here as a non-fatal partial failure.
*/
async function uploadProducedArchive(
api: FeedbackUploadUrlApi,
feedbackId: number,
filename: string,
produce: (archivePath: string) => Promise<FeedbackArchive>,
): Promise<boolean> {
const { archivePath, cleanupDir } = await createFeedbackArchivePath(filename);
let cleanupDir: string | undefined;
try {
const archive = await produce(archivePath);
await uploadArchive(api, { ...archive, cleanupDir }, feedbackId, { filename });
const target = await createFeedbackArchivePath(filename);
cleanupDir = target.cleanupDir;
const archive = await produce(target.archivePath);
await uploadArchive(api, { ...archive, cleanupDir: target.cleanupDir }, feedbackId, {
filename,
});
return true;
} catch (error) {
await logFeedbackUploadError(error);
return false;
} finally {
await rm(cleanupDir, { recursive: true, force: true }).catch(() => {});
if (cleanupDir !== undefined) {
await rm(cleanupDir, { recursive: true, force: true }).catch(() => {});
}
}
}

Expand Down
38 changes: 31 additions & 7 deletions apps/kimi-code/src/tui/commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
feedbackSessionLine,
withFeedbackVersionPrefix,
} from '../constant/feedback';
import { isManagedUsageProvider } from '../constant/kimi-tui';
import { DEFAULT_OAUTH_PROVIDER_NAME, isManagedUsageProvider } from '../constant/kimi-tui';
import { submitFeedbackWithAttachments } from '../../feedback/feedback-attachments';
import { formatErrorMessage } from '../utils/event-payload';
import { openUrl } from '#/utils/open-url';
Expand All @@ -37,9 +37,24 @@ export async function handleFeedbackCommand(host: SlashCommandHost): Promise<voi
openUrl(FEEDBACK_ISSUE_URL);
};

const providerKey = host.state.appState.availableModels[host.state.appState.model]?.provider;
if (!isManagedUsageProvider(providerKey)) {
fallback(FEEDBACK_STATUS_NOT_SIGNED_IN);
// Gate on the OAuth token rather than the active model's provider: a
// signed-in user running an API-key model can still submit feedback
// through the authenticated channel.
let signedIn = false;
try {
const status = await host.harness.auth.status(DEFAULT_OAUTH_PROVIDER_NAME);
signedIn = status.providers.some(
(provider) => provider.providerName === DEFAULT_OAUTH_PROVIDER_NAME && provider.hasToken,
);
} catch {
// The sign-in state is unreadable — keep the feedback entry usable by
// falling back to GitHub Issues instead of failing the command.
fallback(FEEDBACK_STATUS_FALLBACK);
return;
}
if (!signedIn) {
host.showStatus(FEEDBACK_STATUS_NOT_SIGNED_IN);
host.showStatus(FEEDBACK_ISSUE_URL);
return;
}

Expand All @@ -60,8 +75,8 @@ export async function handleFeedbackCommand(host: SlashCommandHost): Promise<voi
const version = withFeedbackVersionPrefix(host.state.appState.version);
const spinner = host.showLoginProgressSpinner(FEEDBACK_STATUS_SUBMITTING);
// Guarantee the spinner's underlying setInterval is always cleared, even when
// submitFeedback or submitFeedbackWithAttachments throws — otherwise the
// interval (and its per-frame requestRender) leaks for the rest of the session.
// submitFeedback throws — otherwise the interval (and its per-frame
// requestRender) leaks for the rest of the session.
let stopped = false;
const stopSpinner = (opts: { ok: boolean; label: string }): void => {
if (stopped) return;
Expand All @@ -84,7 +99,15 @@ export async function handleFeedbackCommand(host: SlashCommandHost): Promise<voi
}

// Stage 3: prepare and upload each requested attachment independently.
const attachmentFailed = await submitFeedbackWithAttachments(host, res.feedbackId, level);
// Attachment failures are non-fatal partial failures — the text feedback
// already exists server-side — so a throw here degrades to the
// partial-failure status, never to the GitHub fallback in the outer catch.
let attachmentFailed = false;
try {
attachmentFailed = await submitFeedbackWithAttachments(host, res.feedbackId, level);
} catch {
attachmentFailed = true;
}

stopSpinner({ ok: true, label: FEEDBACK_STATUS_SUCCESS });
host.showStatus(feedbackSessionLine(host.state.appState.sessionId));
Expand All @@ -95,6 +118,7 @@ export async function handleFeedbackCommand(host: SlashCommandHost): Promise<voi
}
} catch (error) {
stopSpinner({ ok: false, label: FEEDBACK_STATUS_NETWORK_ERROR });
fallback(FEEDBACK_STATUS_FALLBACK);
throw error;
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/kimi-code/src/tui/constant/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const FEEDBACK_STATUS_CANCELLED = 'Feedback cancelled.';
export const FEEDBACK_STATUS_NETWORK_ERROR = 'Network error, failed to submit feedback.';
export const FEEDBACK_STATUS_FALLBACK = 'Opening GitHub Issues as fallback…';
export const FEEDBACK_STATUS_NOT_SIGNED_IN =
"You're not signed in. Opening GitHub Issues for feedback…";
"You're not signed in. Leave feedback on GitHub:";
export const FEEDBACK_STATUS_UPLOAD_FAILED =
'Feedback sent; attachment upload failed — see feedback-upload.log.';

Expand Down
Loading
Loading