Hmbown/CodeWhale · error · anyhow::Error
Invalid transcript.prose_measure: {detail}.
Error message
Invalid transcript.prose_measure: {detail}. What it means
Codewhale's Config::validate rejects an invalid [transcript] prose_measure value. prose_measure caps the column width at which the TUI wraps transcript prose (issue #5436); TranscriptConfig::prose_measure_columns accepts only a non-negative integer, where 0 or an absent key means full content width. Any other raw value (string, float, negative number) produces a detail string that validate wraps as 'Invalid transcript.prose_measure: {detail}.'. Every config load path runs validate, so this fails fast at startup or on /config reload.
Source
Thrown at crates/tui/src/config.rs:4744
anyhow::bail!(
"Invalid sandbox_mode '{mode}': expected read-only, workspace-write, danger-full-access, or external-sandbox."
);
}
}
if let Some(tui) = &self.tui
&& let Some(mode) = tui.alternate_screen.as_deref()
{
let mode = mode.to_ascii_lowercase();
if !matches!(mode.as_str(), "auto" | "always" | "never") {
anyhow::bail!(
"Invalid tui.alternate_screen '{mode}': expected auto, always, or never."
);
}
}
if let Some(transcript) = &self.transcript
&& let Err(detail) = transcript.prose_measure_columns()
{
anyhow::bail!("Invalid transcript.prose_measure: {detail}.");
}
if let Some(auto_review) = &self.auto_review {
auto_review.validate()?;
}
if let Some(providers) = &self.providers {
providers.validate()?;
}
Ok(())
}
/// Resolved prose wrap cap from `[transcript] prose_measure` (#5436).
///
/// `None` (absent or `0`) means prose uses the full content width,
/// consistent with tool/status cells. Invalid values are rejected by
/// [`Config::validate`], which every load path runs, so this resolver
/// cannot fail here.
#[must_use]
pub fn prose_measure(&self) -> Option<u16> {View on GitHub (pinned to 0c42157ee5)
Solutions
- Set prose_measure to a positive whole number of columns, e.g. prose_measure = 80
- Set prose_measure = 0 or delete the key to use the full content width
- Read the {detail} in the error (it prints the raw value) and fix the [transcript] table in the exact config file in use (~/.codewhale/config.toml, --config path, or profile)
Example fix
# before (~/.codewhale/config.toml) [transcript] prose_measure = "80" # after [transcript] prose_measure = 80
Defensive patterns
Strategy: validation
Validate before calling
// Before writing/CI-checking a config, verify the value parses as Codewhale expects:
fn prose_measure_ok(v: &toml::Value) -> bool {
match v.as_integer() {
Some(n) => n >= 0,
None => false, // strings, floats, negatives-as-strings all rejected
}
}
let ok = cfg.get("transcript")
.and_then(|t| t.get("prose_measure"))
.map(prose_measure_ok)
.unwrap_or(true); // absent = valid
assert!(ok, "prose_measure must be a non-negative integer"); Type guard
fn is_valid_prose_measure(v: &toml::Value) -> bool {
v.as_integer().is_some_and(|n| n >= 0)
} Try / catch
match config.validate() {
Err(e) if e.to_string().starts_with("Invalid transcript.prose_measure") => {
eprintln!("fix [transcript] prose_measure (positive integer, 0 = full width): {e}");
}
rest => rest?,
} Prevention
- Keep prose_measure as an unquoted integer in TOML; never copy quoted examples
- Lint checked-in config files in CI with a TOML schema that types prose_measure as u16
- 0 is the explicit 'full width' value - use it instead of deleting when you want the intent recorded
When it happens
Trigger: A config.toml (or --config file or profile) contains [transcript] with prose_measure set to a string (prose_measure = "80"), a float (79.5), a negative integer, or any non-integer TOML value. Loading the config, applying a profile, or persisting a /config change calls Config::validate, which hits the anyhow::bail at crates/tui/src/config.rs:4744.
Common situations: Copying a quoted number from docs or a chat example; hand-editing ~/.codewhale/config.toml and leaving a typo; migrating an old config that tolerated strings; confusing columns with a percentage or float width.
Understand the failure class
Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.
Related errors
- provider auth source command must include at least one non-e
- provider auth source secret must include secret_id
- context_window must be greater than 0
- custom provider '{provider_id}' must set [providers.{provide
- Invalid tui.alternate_screen '{mode}': expected auto, always
AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20).
Data as JSON: /api/errors/6460363b232eabcf.
Report an issue: GitHub.