main fixes: write schema budget, Copy lint, Unix-scoped test imports, /cost fixture

Shortens file tool descriptions and reuses the line_ending schema in WriteTool
(#7070), copies InteractionTarget, scopes test-only imports in app-server, and
updates the /cost [details] diagnostics fixture (requires_argument now true).

Verified: tools::file 191/191, frame:: 37/37, surface_metadata 1/1. app-server
changes are compile-checked only by the in-progress CLI build.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
CodeWhale BotandClaude Sonnet 5.5 committed 2026-10-29 04:03:41 -07:00
1 parent 5661b48b0e
commit 1f0c4d0daa
6 files changed
+15 -17

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ use std::process::{Command, Stdio};
use std::sync::Arc;
use std::time::Duration;
use tokio::io::AsyncWrite;
#[cfg(test)]
#[cfg(all(test, unix))]
use tokio::sync::Mutex;
/// Historical cold-child cache comparator. It has no production producer.
+3 -1
View File
@@ -18,7 +18,9 @@ use std::collections::HashMap;
use std::net::SocketAddr;
use std::path::{Path, PathBuf};
#[cfg(test)]
use std::process::{Child, Command};
use std::process::Child;
#[cfg(all(test, unix))]
use std::process::Command;
use std::sync::Arc;
use std::time::Duration;
use tokio::io::{AsyncBufRead, AsyncWrite, BufReader};
@@ -10,10 +10,10 @@ show_in_empty_discovery: true
---
name: cost
aliases: []
usage: /cost
usage: /cost [details]
description_en: Show session cost breakdown
palette_en: Show session cost breakdown
requires_argument: false
requires_argument: true
unlisted: false
show_in_empty_discovery: true
---
+5 -5
View File
@@ -113,7 +113,7 @@ fn verify_expected_hash(
/// The hidden compatibility schema still has a byte budget, so this is only the
/// instruction the legacy caller needs: what to pass and what happens on a
/// mismatch. The rationale stays in doc comments rather than schema bytes.
pub(super) const EXPECTED_HASH_DESCRIPTION: &str = "The `content_hash` from a prior read; the write is refused and the file left unchanged if it changed since";
pub(super) const EXPECTED_HASH_DESCRIPTION: &str = "Prior read's content_hash; refuse the write if the file has changed.";
// === Cross-harness parameter aliases ===
@@ -1021,7 +1021,7 @@ impl ToolSpec for ReadFileTool {
"properties": {
"path": {
"type": "string",
"description": "Path to the file (relative to workspace, absolute, or ~/ home-relative). Alias: `file_path`"
"description": "File path: workspace-relative, absolute or ~/. Alias: file_path"
},
"start_line": {
"type": "integer",
@@ -1029,11 +1029,11 @@ impl ToolSpec for ReadFileTool {
},
"max_lines": {
"type": "integer",
"description": "Maximum lines to return (default 500, max 500; a 16KB byte budget applies regardless). Aliases: `limit`, `n_lines`"
"description": "Lines: default/max 500, also capped at 16KB. Aliases: limit, n_lines"
},
"pages": {
"type": "string",
"description": "PDF only: page range to extract, e.g. \"1-5\" or \"10\". Ignored for non-PDF files."
"description": "PDF page range, e.g. 1-5 or 10; ignored for other files."
}
},
"required": ["path"]
@@ -1702,7 +1702,7 @@ impl ToolSpec for WriteFileTool {
"line_ending": {
"type": "string",
"enum": ["preserve", "lf", "crlf"],
"description": "Line endings to use: preserve existing style by default, or set lf or crlf when explicitly requested. Explicit selection converts CRLF and lone CR to the requested style."
"description": "Default: preserve existing endings. Explicit lf/crlf converts CRLF and lone CR."
}
},
"required": ["path", "content"]
+2 -5
View File
@@ -126,6 +126,7 @@ impl ToolSpec for WriteTool {
}
fn input_schema(&self) -> Value {
let write = WriteFileTool.input_schema();
json!({
"type": "object",
"properties": {
@@ -134,11 +135,7 @@ impl ToolSpec for WriteTool {
"description": "Path to the file to write (relative or absolute)."
},
"content": { "type": "string", "description": "Content to write to the file." },
"line_ending": {
"type": "string",
"enum": ["preserve", "lf", "crlf"],
"description": "Preserve the existing style by default. Use lf or crlf when explicitly requested; CRLF and lone CR are converted to the selected style."
}
"line_ending": write["properties"]["line_ending"]
},
"required": ["path", "content"],
"additionalProperties": false
+2 -3
View File
@@ -3178,13 +3178,12 @@ mod tests {
assert!(rendered.contains("checkout"), "{rendered}");
assert!(rendered.contains("feature-6112"), "{rendered}");
assert!(rendered.contains("v9.9.9"), "{rendered}");
let target = app
let target = *app
.viewport
.interaction_targets
.iter()
.find(|target| target.id == crate::tui::tideline::InteractionTargetId::HEADER_UPDATE)
.expect("visible update notice is actionable")
.clone();
.expect("visible update notice is actionable");
assert_eq!(
target.mouse_action,
Some(crate::tui::tideline::InteractionAction::OpenUpdate)