Skip to content

Craft Anything: understand how any software works, and craft your own.

Rust

Stop Just ask reporting the build's tools as disconnected (#1024)

adamsardo4ffa36505930
diff --git a/crates/ai/src/rebuild/question.rs b/crates/ai/src/rebuild/question.rs
index c13c27b3..d19e44fe 100644
--- a/crates/ai/src/rebuild/question.rs
+++ b/crates/ai/src/rebuild/question.rs
@@ -32,7 +32,7 @@ const SCAN_DEPTH: usize = 12;
/// Folders a build makes again, never listed.
const SKIPPED: &[&str] = &["node_modules", "target", ".godot", "Library", "Temp", "obj", ".venv", "__pycache__", ".next", ".turbo", ".git"];
-const PREAMBLE: &str = "You're answering a question the person asked about the project you built inside Craft Anything. This isn't a task: answer it and stop. Don't create, change or delete any file, don't run anything, and don't carry on the build; if the answer is that something should change, say what you'd change and that they can ask for it as a change. Answer in plain words for someone who doesn't code, briefly, with full paths when they ask where something is.\n\n";
+const PREAMBLE: &str = "You're answering a question the person asked about the project you built inside Craft Anything. This isn't a task: answer it and stop. Don't create, change or delete any file, don't run anything, and don't carry on the build; if the answer is that something should change, say what you'd change and that they can ask for it as a change. Answer in plain words for someone who doesn't code, briefly, with full paths when they ask where something is. You're a short-lived copy with fewer tools than the builder, and the build may still be running beside you. So a tool you can't see here is not a tool the build has lost, and a call with no result here may still be running: never report tools as disconnected or work as cut off because of what you see from here.\n\n";
/// How a question was answered.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
@@ -277,6 +277,13 @@ fn ago(d: Duration) -> String {
mod tests {
use super::*;
+ /// A copy of the builder's session has no tool server, and saw the build's tools as gone.
+ #[test]
+ fn a_question_is_told_its_missing_tools_are_not_the_builds() {
+ assert!(PREAMBLE.contains("never report tools as disconnected"));
+ assert!(PREAMBLE.contains("may still be running"));
+ }
+
/// A question that finds the builder's session missing forgets it, unless a build has saved
/// another meanwhile: then that one stays.
#[test]
diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md
index e04e5f7b..5da07d33 100644
--- a/docs/ROADMAP.md
+++ b/docs/ROADMAP.md
@@ -832,6 +832,8 @@ Gaps found while using the app for real projects.
- [ ] A question's own cost: a forked Claude Code session reports the whole session's running
total, so a forked answer shows none; count questions in the project's usage
- [ ] "Make this change" on an answer that suggests one (sends it as a normal message)
+- [x] "Just ask" is told it has fewer tools than the builder and that the build may be running
+ beside it, so it no longer reports the build's tools as disconnected or its work as cut off
- [x] "Change it" knows what was just talked about in "Just ask": the next message tells the builder
the latest few questions and answers, once, and a Clean room build only those asked in Clean
room (#857). Not checked in a live build