BigPizzaV3/CodexPlusPlus · error · anyhow::Error
user-script runtime status must be a JSON object
Error message
user-script runtime status must be a JSON object
What it means
解析 CDP evaluate 返回的 user-script 运行时状态时,从 /result/result/value 取出的字符串经 serde_json 反序列化后不是 JSON object(可能是 null、数组或字符串),于是 parse_live_runtime_status_response 的类型校验失败。注意页面脚本本身用 || {} 兜底,因此真正到达此处的通常是序列化/反序列化产生的非对象值。
Source
Thrown at crates/codex-plus-core/src/user_scripts.rs:42
"(() => JSON.stringify(window.__codexPlusUserScripts?.scripts || {}))()",
)
.await?;
parse_live_runtime_status_response(&response)
}
fn live_runtime_target(targets: &[crate::cdp::CdpTarget]) -> anyhow::Result<crate::cdp::CdpTarget> {
crate::cdp::pick_injectable_codex_page_target(targets)
}
fn parse_live_runtime_status_response(response: &Value) -> anyhow::Result<Value> {
let encoded = response
.pointer("/result/result/value")
.and_then(Value::as_str)
.context("user-script runtime probe returned no value")?;
let status: Value =
serde_json::from_str(encoded).context("invalid user-script runtime status JSON")?;
if !status.is_object() {
anyhow::bail!("user-script runtime status must be a JSON object");
}
Ok(status)
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct UserScriptConfig {
pub enabled: bool,
pub scripts: BTreeMap<String, bool>,
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
pub market: BTreeMap<String, MarketScriptInstall>,
}
impl Default for UserScriptConfig {
fn default() -> Self {
Self {
enabled: true,
scripts: BTreeMap::new(),
market: BTreeMap::new(),View on GitHub (pinned to f2074595a2)
Solutions
- 检查注入页面里 window.__codexPlusUserScripts 的实际结构,确认 scripts 字段未被覆盖为非对象
- 确认 CDP evaluate 返回链路(result/result/value 路径)没有截断或转义破坏 JSON
- 在浏览器控制台手动执行探测脚本核对返回值
- 若页面尚未注入 user-script runtime,先等待注入完成再探测
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at crates/codex-plus-core/src/user_scripts.rs:42 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23).
Data as JSON: /api/errors/28385b507f3ea9d6.
Report an issue: GitHub.