{"record":{"id":"bc7aaf78ac6b405c","repo":"can1357/oh-my-pi","slug":"no-configured-compaction-method-can-run-manually","errorCode":null,"errorMessage":"No configured compaction method can run manually.","messagePattern":"No configured compaction method can run manually\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/session/session-maintenance.ts","lineNumber":789,"sourceCode":"\t\t\t\tif (method === \"snapcompact\") {\n\t\t\t\t\tif (\n\t\t\t\t\t\texplicitSnapcompact ||\n\t\t\t\t\t\t(!customInstructions && !options?.internalGuidance && activeModel.input.includes(\"image\"))\n\t\t\t\t\t) {\n\t\t\t\t\t\tselectedMethod = method;\n\t\t\t\t\t\tselectedMethodIndex = index;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (method === \"soft\") {\n\t\t\t\t\tselectedMethod = method;\n\t\t\t\t\tselectedMethodIndex = index;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!selectedMethod) {\n\t\t\t\tthrow new Error(\"No configured compaction method can run manually.\");\n\t\t\t}\n\n\t\t\tconst effectiveSettings = resolveMethodSettings(compactionSettings, selectedMethod);\n\t\t\tconst availableModels = this.#host.modelRegistry.getAvailable();\n\t\t\tconst requireProviderRemote = selectedMethod === \"remote\" && !effectiveSettings.remoteEndpoint;\n\t\t\tconst compactionCandidates = this.#getCompactionModelCandidates(\n\t\t\t\tavailableModels,\n\t\t\t\trequireProviderRemote\n\t\t\t\t\t? candidate =>\n\t\t\t\t\t\t\tcandidate.provider === activeModel.provider &&\n\t\t\t\t\t\t\tshouldUseProviderNativeCompaction(candidate, effectiveSettings)\n\t\t\t\t\t: undefined,\n\t\t\t);\n\t\t\tif (requireProviderRemote && compactionCandidates.length === 0) {\n\t\t\t\tthis.#host.emitNotice(\n\t\t\t\t\t\"warning\",\n\t\t\t\t\t`remote compaction is unavailable for ${activeModel.id}; trying the next preferred method`,\n\t\t\t\t\t\"compaction\",","sourceCodeStart":771,"sourceCodeEnd":807,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/session/session-maintenance.ts#L771-L807","documentation":"Thrown when the ordered list of configured compaction methods (`compaction.methodOrder`, possibly overridden by the compact mode) yields no method eligible to run manually. Each method has applicability conditions (e.g. `remote` requires a reachable server endpoint configuration; methods may be filtered by manual-run rules); if all configured methods are filtered out, nothing can execute.","triggerScenarios":"Running manual compaction when `compaction.methodOrder` contains only methods that fail their manual-run preconditions — classically a methodOrder of just `remote` with no usable remote endpoint, or a custom methodOrder whose entries are all skipped by the availability checks in the loop just above the throw.","commonSituations":"Configuring `\"methodOrder\": [\"remote\"]` without a remote compaction server set up; a custom settings file pruning methods after an upgrade renamed/removed one; using a compact mode override that intersects with settings to an empty/unusable set.","solutions":["Add a locally runnable method to `compaction.methodOrder` (e.g. include `\"soft\"`).","If you intend remote compaction, configure the remote endpoint/settings so the remote method is eligible.","Reset compaction settings to defaults to restore a workable methodOrder."],"exampleFix":"// before (settings.json)\n{ \"compaction\": { \"methodOrder\": [\"remote\"] } }\n// after\n{ \"compaction\": { \"methodOrder\": [\"remote\", \"soft\"] } }","handlingStrategy":"validation","validationCode":"const order = compactMode?.overrides.methodOrder ?? settings.getGroup(\"compaction\").methodOrder;\nif (!order.some(m => m === \"soft\" || m === \"remote\")) {\n  throw new Error(\"methodOrder has no manually runnable method; include 'soft' or configure remote\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  await session.compact();\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"No configured compaction method\")) {\n    settings.getGroup(\"compaction\").methodOrder = [\"remote\", \"soft\"];\n    await session.compact();\n    return;\n  }\n  throw err;\n}","preventionTips":["Keep `soft` in compaction.methodOrder as a guaranteed-local fallback.","If you list `remote`, configure the remote endpoint in the same settings change.","After upgrading, diff your compaction settings against new defaults for renamed/removed methods."],"tags":["compaction","configuration","method-order"],"backgroundTag":"no-eligible-compaction-method","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}