Skip to content

Commit 460548c

Browse files
committed
fix: resolve remaining marketplace review source-code warnings
- drop type assertions the compiler no longer needs, including the SDK effortLevel workaround that @qoder-ai/qoder-agent-sdk 1.0.16 made obsolete - stop awaiting the void leaf.detach() in duplicate-leaf cleanup - bind child.kill instead of extracting the unbound method in the Windows tree-aware kill shim - mark intentionally fire-and-forget closePersistentQuery calls with void in resetSession and setSessionId
1 parent c517dd4 commit 460548c

10 files changed

Lines changed: 11 additions & 15 deletions

File tree

src/app/settings/settings-storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function normalizeKeyboardNavigation(value: unknown): KeyboardNavigationSettings
104104
const candidate = value as Partial<Record<keyof KeyboardNavigationSettings, unknown>>;
105105
const pick = (key: keyof KeyboardNavigationSettings): string =>
106106
typeof candidate[key] === 'string' && candidate[key]
107-
? candidate[key] as string
107+
? candidate[key]
108108
: defaults[key];
109109

110110
return {

src/features/chat/chat-view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class QoderianView extends ItemView {
6161
// overwritten by prototype patching. Hover Editor patches QoderianView.prototype.load
6262
// after our class is defined, but instance methods take precedence over prototype methods.
6363
const prototype = Object.getPrototypeOf(this) as LoadableView;
64-
const originalLoad = prototype.load.bind(this) as () => Promise<void> | void;
64+
const originalLoad = prototype.load.bind(this);
6565
Object.defineProperty(this, 'load', {
6666
value: async () => {
6767
// Ensure containerEl exists before any patched load code tries to use it

src/features/chat/tabs/tab-qoder-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function getTabSettingsSnapshot(
4141
_tab: TabQoderContext,
4242
plugin: QoderianPlugin,
4343
): TabQoderSettings {
44-
return plugin.settings as TabQoderSettings;
44+
return plugin.settings;
4545
}
4646

4747
export function getTabPermissionMode(

src/features/chat/ui/status-panel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class StatusPanel {
129129
addBashOutput(info: PanelBashOutput): void {
130130
this.currentBashOutputs.set(info.id, info);
131131
while (this.currentBashOutputs.size > MAX_BASH_OUTPUTS) {
132-
const oldest = this.currentBashOutputs.keys().next().value as string | undefined;
132+
const oldest = this.currentBashOutputs.keys().next().value;
133133
if (!oldest) break;
134134
this.currentBashOutputs.delete(oldest);
135135
this.bashEntryExpanded.delete(oldest);

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export default class QoderianPlugin extends Plugin {
202202
for (const leaf of leaves) {
203203
if (leaf === keepLeaf) continue;
204204
try {
205-
await leaf.detach();
205+
leaf.detach();
206206
} catch {
207207
// Best-effort cleanup; the leaf may already be detached.
208208
}

src/qoder/history/qoder-conversation-history-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function sanitizeQoderState(
307307
return undefined;
308308
}
309309

310-
return Object.fromEntries(sanitizedEntries) as QoderState;
310+
return Object.fromEntries(sanitizedEntries);
311311
}
312312

313313
export function buildPersistedQoderState(

src/qoder/runtime/custom-spawn.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ function installTreeAwareKill(child: ChildProcess, spawnSpec: WindowsCmdShimSpaw
7373
return;
7474
}
7575

76-
const originalKill = child.kill;
77-
const callOriginalKill = (signal?: NodeJS.Signals | number): boolean =>
78-
originalKill.call(child, signal);
76+
const callOriginalKill = child.kill.bind(child);
7977
const killableChild = {
8078
get pid(): number | undefined {
8179
return child.pid;

src/qoder/runtime/qoder-chat-runtime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ export class QoderChatRuntime implements ChatRuntime {
11781178
*/
11791179
resetSession() {
11801180
// Close persistent query (new session will use cold-start resume)
1181-
this.closePersistentQuery('session reset');
1181+
void this.closePersistentQuery('session reset');
11821182

11831183
// Reset crash recovery for fresh start
11841184
this.crashRecoveryAttempted = false;
@@ -1258,7 +1258,7 @@ export class QoderChatRuntime implements ChatRuntime {
12581258

12591259
// Close synchronously when session changes
12601260
if (sessionChanged) {
1261-
this.closePersistentQuery('session switch');
1261+
void this.closePersistentQuery('session switch');
12621262
this.crashRecoveryAttempted = false;
12631263
}
12641264

src/qoder/runtime/qoder-dynamic-updates.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ export async function applyQoderDynamicUpdates(
7979
const currentEffort = deps.getCurrentConfig()?.effortLevel ?? null;
8080
if (effortLevel !== currentEffort) {
8181
try {
82-
// SDK runtime accepts `max`, but the current type definition for
83-
// Settings.effortLevel has not caught up yet.
84-
await persistentQuery.applyFlagSettings({ effortLevel } as unknown as Parameters<Query['applyFlagSettings']>[0]);
82+
await persistentQuery.applyFlagSettings({ effortLevel });
8583
deps.mutateCurrentConfig(config => {
8684
config.effortLevel = effortLevel;
8785
});

src/qoder/services/qoder-title-generation-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class QoderTitleGenerationService {
7474
const titleModel = this.plugin.settings.titleGenerationModel || 'auto';
7575
if (qoderModelConfig.isKnownModel(
7676
titleModel,
77-
this.plugin.settings as unknown as Record<string, unknown>,
77+
this.plugin.settings,
7878
)) {
7979
return toQoderRuntimeModelId(titleModel);
8080
}

0 commit comments

Comments
 (0)