Hmbown/CodeWhale · error · Error
Thread summaries require the runtime bearer token.
Error message
Thread summaries require the runtime bearer token.
What it means
validate_staged found a manifest at the staged root, but PluginManifest::validate_from_path rejected its contents — a parse failure (malformed JSON/TOML) or a schema violation such as a missing/invalid [plugin] table or name. The staged copy is only accepted after the manifest validates and its content hash is computed, so this aborts the install before anything reaches the user plugins directory. The underlying validator error is chained into the message, so the full anyhow chain names the offending field.
Source
Thrown at extensions/vscode/src/runtime.ts:116
kind: "connected",
baseUrl,
detail: version ? `Connected to CodeWhale ${version}.` : "Connected to CodeWhale runtime.",
version,
};
}
export async function listThreadSummaries(
config: RuntimeConfig,
limit = 8,
): Promise<ThreadSummary[]> {
const baseUrl = runtimeBaseUrl(config);
const response = await requestJson(
`${baseUrl}/v1/threads/summary?limit=${encodeURIComponent(String(limit))}`,
config.token,
);
if (response.statusCode === 401) {
throw new Error("Thread summaries require the runtime bearer token.");
}
if (response.statusCode !== 200) {
throw new Error(`Thread summary returned HTTP ${response.statusCode}.`);
}
return readThreadSummaries(response.body);
}
export async function listSnapshots(config: RuntimeConfig, limit = 8): Promise<SnapshotEntry[]> {
const baseUrl = runtimeBaseUrl(config);
const response = await requestJson(
`${baseUrl}/v1/snapshots?limit=${encodeURIComponent(String(limit))}`,
config.token,
);
if (response.statusCode === 401) {
throw new Error("Restore points require the runtime bearer token.");
}View on GitHub (pinned to 8880682c63)
Solutions
- Read the chained {error} — it names the exact parse/validation failure; fix that field in the source manifest.
- Open the staged manifest and validate it locally: it must parse and carry a valid [plugin] section with a name.
- Compare against a known-good bundle's manifest shape — mismatched top-level structure is the usual cause after spec changes.
- Re-download or rebuild the bundle if the manifest looks truncated or contains an error page.
Example fix
# before: plugin.json fails validation
{ "plugin": { "nam": "demo" } }
# after
{ "plugin": { "name": "demo", "version": "0.1.0" } } Defensive patterns
Strategy: validation
Validate before calling
let manifest_path = crate::plugins::agent_plugin::resolve_manifest_path(source)
.context("bundle has no root manifest")?;
PluginManifest::validate_from_path(&manifest_path)
.map_err(|e| anyhow::anyhow!("fix the manifest before staging: {e}"))?; Type guard
fn bundle_validatable(bundle: &Path) -> bool {
crate::plugins::agent_plugin::resolve_manifest_path(bundle)
.and_then(|m| std::fs::read_to_string(m).ok())
.map(|raw| serde_json::from_str::<serde_json::Value>(&raw).is_ok())
.unwrap_or(false)
} Try / catch
match validate_staged(&staged_path) {
Ok((name, hash)) => (name, hash),
Err(e) if e.to_string().contains("staged plugin manifest failed validation") =>
return Err(e).context("repair the plugin.json/plugin.toml in the source bundle and reinstall"),
Err(e) => return Err(e),
} Prevention
- Validate the manifest in the source repo before packaging, not after staging.
- Run a JSON/TOML linter over plugin manifests in CI.
- Keep bundles on the manifest schema version the installer supports; re-test after upgrading.
- Treat unparseable manifests in downloads as corruption: re-fetch rather than patch.
When it happens
Trigger: Installing a bundle whose plugin.json is syntactically broken, is missing the required plugin.name field, or carries a structure the current manifest schema rejects; e.g. a bundle authored for a different plugin spec version than the installer supports.
Common situations: Typos while hand-writing plugin.json (trailing commas, wrong table name in TOML); plugin specs from an incompatible client version; manifests generated by a script that emitted an error body; empty manifest file from a failed checkout or partial download.
Related errors
- Restore points require the runtime bearer token.
- Restore points returned HTTP ${response.statusCode}.
- parallel(): max ${MAX_ITEMS} items per call
- pipeline(): expected an array of items
- pipeline(): max ${MAX_ITEMS} items per call
AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16).
Data as JSON: /api/errors/35f071b4b0735e2a.
Report an issue: GitHub.