Repository navigation
Conversation
|
由 LW 授权的 MOI 智能体提交。 red→green 独立复核记录(2026-10-21 本轮自动化回访) 状态快照:head 1. green 实现逐项审计(
2. 门禁与续接状态(截至本评论)
本轮运行时未绑定 git 推送凭证(沙箱 unbound,git push 不可用),且观察到并行自动化正在迭代该分支(02:47 与 03:03 两次推送),为避免竞态本智能体不直接改动分支,仅以本评论记录复核证据与续接待办。 |
|
由 LW 授权的 MOI 智能体提交。 PR #1102 本轮(2026-10-21 04:2x UTC)自动化回访快照 1. 分支演进复核(上轮 head
2. CI 实测(均为 head
3. 门禁与后续
|
|
由 LW 授权的 MOI 智能体提交。 PR #1102 回访快照(2026-10-21 05:1x UTC) 1. 等待条件复核(相对上一评论 04:26:11Z 的增量证据)
2. 本轮结论
|
|
由 LW 授权的 MOI 智能体提交。 PR #1102 回访快照(2026-10-21 06:0x UTC / 14:0x CST,增量相对上一条 05:13:47Z 评论) 1. 等待条件复核(全部为本轮实测)
2. 本轮结论
3. 下一轮接续条件(沿上一条评论,按序核验) (a) main 出现 lockfile 修复或 #1103 关闭 → (b) 分支同步 main 并重跑 Static Checks 变绿(需代码推送通道)→ (c) 独立复审通过 → 才可置 ready 并 assign @XuPeng-SH 请求审阅。 由 LW 授权的 MOI 智能体提交。 |
Replay the reviewed one-file fix on main b232c4a after the RustSec lockfile update. Preserve the original red/green evidence in PR matrixorigin#1102. 由 LW 授权的 ChatGPT Personal 智能体提交。
e37fb20 to
7d6dbd9
Compare
|
由 LW 授权的 ChatGPT Personal 智能体提交。 接续核验及分支操作记录:#1104 已由上游合入,原 RustSec 依赖阻塞已解除。已在本人 fork MatrixAdventurer/Astra 创建 archive/1045-before-sync-20261021-2206,保留原 head e37fb20 及红/绿测试历史;随后以 expected_sha 租约将本 PR 独立分支重放至 main b232c4a,当前 head 7d6dbd9。没有改写上游或 fork 的默认分支。 修复内容保持一个文件 +97/-29;目标文件 blob 4338a6b30caef3ed238b5f4a1bea512542d946d4 与此前审查版本完全一致,上游期间未修改该文件。独立 review agent 对同步补丁明确 Approve;git diff --check 通过。连接器发布的完整 tree c04621a2877304a20e7fec72df21330c5c700bb4 与本地固定提交 bb805d60d3c36fdfc3907f53a15dcd1c2179129a 完全一致。 历史真实回归红/绿结果继续有效,但不冒充新 head 的 CI。本轮尝试安装仓库指定 Rust 工具链,rustup 在受限环境因 /proc/self/exe 不可用退出;改由本 fork PR 的实际 CI 验证新 head。新一轮门禁完成前保留 Draft。只读核验执行主体同本署名。 |
|
由 LW 授权的 ChatGPT Personal 智能体提交。 发布后独立复审已完成:review agent 独立 fetch 当前远程 head 7d6dbd9,核对 parent、完整 tree、空全树差异、1 文件 +97/-29、署名及 diff --check,明确 Approve。该审查未声称运行 Rust 测试。 本轮附加本地实际命令与限制: 当前 head 的真实 GitHub CI 已启动:Static Checks 39614929579 运行中,仓库元数据、workflow、CI contracts 检查及 Docker dependency inputs 已通过,clippy 正在运行;Test Suite 39614929641 排队;PR Title 已通过。以上为快照,完整门禁尚未通过,不以历史或局部结果替代。下一步读回这些固定 run 的结果,必要时修复实际失败并独立复审;全部规定门禁通过后转 ready、指派 XuPeng-SH 并请求审阅。 |
|
Required-gate readback on the fixed head
With both required runs green on the synchronized head and the previously recorded independent review approval unchanged, this PR has now been:
No merge is requested or claimed; merging remains with the maintainer. 由 LW 授权的 MOI 智能体提交。 |
XuPeng-SH
left a comment
There was a problem hiding this comment.
The NO_COLOR change does not reach the CLI tool-progress rendering path that issue #1045 describes. The added helper tests pass, but a source-level reproduction through the actual read-file description still emits ANSI styling with NO_COLOR=1. Please update the renderer that owns tool progress and cover that user-visible path.
|
由 LW 授权的 MOI 智能体提交。 PR #1102 续办记录(2026-10-22 00:2x UTC 自动化回访轮) 本轮只处理评审 requested changes(review 5607566162,2026-10-21T23:42:10Z,@XuPeng-SH),不新建 Issue/PR、不推进分支、不合并、不关闭。 1. 意见确认与根因定位(采纳,有依据)
2. 修复设计与重建依据(本轮已完成设计;补丁未推送)
3. 阻塞如实清单
|
|
本操作由 LW 授权的 MOI 智能体提交。 @XuPeng-SH 这是针对 review 5607566162(CHANGES_REQUESTED,2026-10-21T23:42Z)的修订补丁,仅涉及 1 个文件 评审意见 → 改动映射
验证证据与状态(如实)
补丁 diff --git a/crates/astra-cli/src/cli/stream/stream_render.rs b/crates/astra-cli/src/cli/stream/stream_render.rs
index 6fda88c..9d1518e 100644
--- a/crates/astra-cli/src/cli/stream/stream_render.rs
+++ b/crates/astra-cli/src/cli/stream/stream_render.rs
@@ -6966,10 +6966,19 @@ struct ToolOutputSummary {
text: String,
}
-fn format_terminal_tool_summary(tool: &str, summary: &ToolOutputSummary, warning: bool) -> String {
+fn format_terminal_tool_summary(
+ tool: &str,
+ summary: &ToolOutputSummary,
+ warning: bool,
+ plain: bool,
+) -> String {
let is_edit_diff = matches!(summary.kind, ToolOutputSummaryKind::Diff)
&& matches!(tool, "write_file" | "str_replace" | "multi_edit");
- let rendered = if is_edit_diff {
+ let rendered = if plain {
+ // NO_COLOR: keep the row geometry (edit diffs still own the edge)
+ // but never emit ANSI sequences.
+ summary.text.clone()
+ } else if is_edit_diff {
colorize_diff_summary(&summary.text)
} else {
match summary.kind {
@@ -7262,10 +7271,25 @@ impl StreamRenderState {
}
}
+ /// Tool-progress lines honor the `NO_COLOR` convention on every stream
+ /// (pipe or terminal): when the variable is exported (any value),
+ /// descriptions, durations and summaries render plain. The rule mirrors
+ /// `tui::theme`'s `NO_COLOR` handling so both render paths agree.
+ fn tool_progress_plain(&self) -> bool {
+ std::env::var_os("NO_COLOR").is_some()
+ }
+
/// Show a tool as "running" with Cursor-style description (single line).
fn tool_start(&mut self, tool: &str, args: &Value) -> usize {
let description = self.format_tool_description(tool, args);
- let styled_desc = style_tool_description(tool, &description);
+ // Tool-progress styling is owned here: honor NO_COLOR so redirected
+ // stderr and explicit no-color terminals both render plain text.
+ let plain = self.tool_progress_plain();
+ let styled_desc = if plain {
+ description.clone()
+ } else {
+ style_tool_description(tool, &description)
+ };
if let Some(pane) = self.thinking_pane.take() {
let summary = pane.summary_line();
self.clear_thinking_with_summary(pane, &summary);
@@ -7323,7 +7347,11 @@ impl StreamRenderState {
if io::stderr().is_terminal() {
self.tool_stderr_running = Some(ToolRunningLineSpinner::start(description));
} else {
- let line = format!(" {} {} …", theme::icon_running(), description.dim());
+ let line = if self.tool_progress_plain() {
+ format!(" {} {} …", theme::icon_running(), description)
+ } else {
+ format!(" {} {} …", theme::icon_running(), description.dim())
+ };
eprintln!("{line}");
self.stderr_lines += 1;
}
@@ -7397,35 +7425,52 @@ impl StreamRenderState {
let duration_suffix = format_duration_suffix(duration_ms);
// Get smart icon based on status and output analysis.
let (icon, is_warning) = tool_completion_icon(tool, status, output, duration_ms);
+ let plain = self.tool_progress_plain();
let extra_line = if tool_result_status_is_failure(status) {
let err_msg = output_summary
.as_ref()
.map(|summary| summary.text.clone())
.unwrap_or_else(|| "failed".to_string());
- format!(" {}", err_msg.red())
+ if plain {
+ format!(" {err_msg}")
+ } else {
+ format!(" {}", err_msg.red())
+ }
} else if tool_result_status_is_skipped(status) {
// Skipped = protective deduplication. Show as dim warning, not red error.
let msg = output_summary
.as_ref()
.map(|summary| summary.text.clone())
.unwrap_or_else(|| "skipped (duplicate)".to_string());
- format!(" {}", msg.dim())
+ if plain {
+ format!(" {msg}")
+ } else {
+ format!(" {}", msg.dim())
+ }
} else if is_warning {
output_summary
.as_ref()
- .map(|summary| format_terminal_tool_summary(tool, summary, true))
+ .map(|summary| format_terminal_tool_summary(tool, summary, true, plain))
.unwrap_or_default()
} else {
output_summary
.as_ref()
- .map(|summary| format_terminal_tool_summary(tool, summary, false))
+ .map(|summary| format_terminal_tool_summary(tool, summary, false, plain))
.unwrap_or_default()
};
if self.md.is_some() {
self.stop_tool_stderr_running();
let description = self.format_tool_description_with_output(tool, args, Some(output));
- let styled_desc = style_tool_description(tool, &description);
- let dur_display = format!("{}", duration_suffix.dim());
+ let styled_desc = if plain {
+ description.clone()
+ } else {
+ style_tool_description(tool, &description)
+ };
+ let dur_display = if plain {
+ duration_suffix.clone()
+ } else {
+ format!("{}", duration_suffix.dim())
+ };
let mut out_lines = 1usize;
eprintln!(" {} {}{}", icon, styled_desc, dur_display);
if !extra_line.is_empty() {
@@ -7442,8 +7487,16 @@ impl StreamRenderState {
}
self.stop_tool_stdout_anim();
let description = self.format_tool_description_with_output(tool, args, Some(output));
- let styled_desc = style_tool_description(tool, &description);
- let dur_display = format!("{}", duration_suffix.dim());
+ let styled_desc = if plain {
+ description.clone()
+ } else {
+ style_tool_description(tool, &description)
+ };
+ let dur_display = if plain {
+ duration_suffix.clone()
+ } else {
+ format!("{}", duration_suffix.dim())
+ };
let mut g = astra_core::sync_poison::recover_mutex_lock(&self.tool_ui);
if idx < g.lines.len() {
g.lines[idx] = format!(" {icon} {styled_desc}{dur_display}");
@@ -7476,8 +7529,17 @@ impl StreamRenderState {
let output_summary = self.format_output_summary(tool, output, status);
let duration_suffix = format_duration_suffix(duration_ms);
let description = self.format_tool_description_with_output(tool, args, Some(output));
- let styled_desc = style_tool_description(tool, &description);
- let dur_display = format!("{}", duration_suffix.dim());
+ let plain = self.tool_progress_plain();
+ let styled_desc = if plain {
+ description.clone()
+ } else {
+ style_tool_description(tool, &description)
+ };
+ let dur_display = if plain {
+ duration_suffix.clone()
+ } else {
+ format!("{}", duration_suffix.dim())
+ };
// Get smart icon based on status and output analysis.
let (icon, is_warning) = tool_completion_icon(tool, status, output, duration_ms);
@@ -7486,23 +7548,31 @@ impl StreamRenderState {
.as_ref()
.map(|summary| summary.text.clone())
.unwrap_or_else(|| "failed".to_string());
- format!(" {}", err_msg.red())
+ if plain {
+ format!(" {err_msg}")
+ } else {
+ format!(" {}", err_msg.red())
+ }
} else if tool_result_status_is_skipped(status) {
// Skipped = protective deduplication. Show as dim warning, not red error.
let msg = output_summary
.as_ref()
.map(|summary| summary.text.clone())
.unwrap_or_else(|| "skipped (duplicate)".to_string());
- format!(" {}", msg.dim())
+ if plain {
+ format!(" {msg}")
+ } else {
+ format!(" {}", msg.dim())
+ }
} else if is_warning {
output_summary
.as_ref()
- .map(|summary| format_terminal_tool_summary(tool, summary, true))
+ .map(|summary| format_terminal_tool_summary(tool, summary, true, plain))
.unwrap_or_default()
} else {
output_summary
.as_ref()
- .map(|summary| format_terminal_tool_summary(tool, summary, false))
+ .map(|summary| format_terminal_tool_summary(tool, summary, false, plain))
.unwrap_or_default()
};
@@ -14480,6 +14550,83 @@ mod tests {
}
}
+ #[test]
+ fn format_terminal_tool_summary_plain_waves_ansi_sequences() {
+ let summary = ToolOutputSummary {
+ kind: ToolOutputSummaryKind::Preview,
+ text: "12 output lines captured".to_string(),
+ };
+ let plain = format_terminal_tool_summary("read_file", &summary, false, true);
+ assert_eq!(plain, " 12 output lines captured");
+ let colored = format_terminal_tool_summary("read_file", &summary, false, false);
+ assert!(
+ colored.contains('\x1b'),
+ "colored leg must keep styling: {colored:?}"
+ );
+ }
+
+ /// `NO_COLOR` is process-global, so the real tool-progress owner methods
+ /// are asserted through an isolated test binary (the `tui::theme`
+ /// child-process pattern) with stderr redirected to a pipe.
+ #[test]
+ fn tool_progress_honors_no_color_on_redirected_streams() {
+ const CASE: &str = "ASTRA_CLI_TEST_NO_COLOR_TOOL_PROGRESS";
+
+ match std::env::var_os(CASE).map(|v| v.to_string_lossy().to_string()) {
+ Some(leg) if leg == "plain" || leg == "colored" => {
+ let mut s = StreamRenderState::new();
+ s.tool_start_parallel_group(3);
+ let args = serde_json::json!({"path": "cli.rs", "content": "body"});
+ s.tool_done_inline(
+ "read_file",
+ &args,
+ "completed",
+ 12,
+ "12 output lines\ncli.rs preview bytes",
+ );
+ return;
+ }
+ _ => {}
+ }
+
+ let test_name = format!(
+ "{}::tool_progress_honors_no_color_on_redirected_streams",
+ module_path!().split_once("::").unwrap().1
+ );
+ for (leg, no_color) in [("plain", true), ("colored", false)] {
+ let mut cmd = std::process::Command::new(std::env::current_exe().unwrap());
+ cmd.args(["--exact", test_name.as_str(), "--nocapture"])
+ .env(CASE, leg);
+ if no_color {
+ cmd.env("NO_COLOR", "1");
+ } else {
+ cmd.env_remove("NO_COLOR");
+ }
+ let output = cmd.output().expect("spawn isolated tool-progress test");
+ let stderr = String::from_utf8_lossy(&output.stderr).to_string();
+ assert!(output.status.success(), "{leg} leg failed: {stderr:?}");
+ assert!(
+ stderr.contains("Running 3 tools in parallel"),
+ "{leg} leg lost the running line: {stderr:?}"
+ );
+ assert!(
+ stderr.lines().count() >= 2,
+ "{leg} leg lost the tool-done line: {stderr:?}"
+ );
+ if no_color {
+ assert!(
+ !stderr.contains('\x1b'),
+ "NO_COLOR leg must not emit ANSI: {stderr:?}"
+ );
+ } else {
+ assert!(
+ stderr.contains('\x1b'),
+ "colored leg must keep styling: {stderr:?}"
+ );
+ }
+ }
+ }
+
#[test]
fn approval_required_enqueues_pending() {
let mut r = TurnResult::new();
@@ -14993,7 +15140,7 @@ mod tests {
text: "@@ -1 +1 @@\n-old\n+new".into(),
};
- let rendered = format_terminal_tool_summary("str_replace", &summary, false);
+ let rendered = format_terminal_tool_summary("str_replace", &summary, false, false);
let plain = crate::cli::terminal_region::strip_ansi_codes(&rendered);
let rows = plain.lines().collect::<Vec<_>>();
|
|
本操作由 LW 授权的 MOI 智能体提交。 PR #1102 本轮(2026-10-22 00:30 UTC 无人值守回访)状态读回与续审记录: 1. 状态读回(实测)
2. 本轮独立复核(评审意见依据与补丁映射,如实范围声明)
3. 阻塞与续接
由 LW 授权的 MOI 智能体提交。 |
|
Follow-up on the pending requested changes (review 5607566162). This is an incremental status note on top of the 2026-10-22T00:2x 续办记录 above, not a duplicate; the fix design recorded there stands unchanged. This automation round re-verified the delivery blockers with direct evidence gathered in the current runtime:
Consequently nothing has been pushed and no test, CI, or review pass is claimed for this round. The requested changes remain open and correctly understood: gate the crossterm Branch advancement requires an execution runtime with network egress, push credentials for the fork, and a workspace-compatible Rust toolchain; the design and test plan are recorded in the previous comment and can be executed directly once those are available. No merge, close, or issue automation is requested or attempted. 由 LW 授权的 MOI 智能体提交。 |
|
由LW授权的MOI智能体提交 —— 接续 @XuPeng-SH 在本 PR 的 requested changes,本轮仅处理本 PR 一个对象。 修复:
|
7d6dbd9 to
26479f6
Compare
|
由 LW 授权的 MOI 智能体提交。 PR #1102 本轮(2026-10-22 06:30 UTC 起无人值守运行)自动化回访快照 1. Review 状态(回访起点)
2. 分支响应复核(并行授权自动化已迭代,本轮不改动分支)
3. CI 实测(head
4. 待办与续接
|
|
由 LW 授权的 MOI 智能体提交(2026-10-22 06:00 UTC 运行,单对象回访:本 PR)。 接续记录:review 5607566162 所提 requested changes 的处置核对与最新读回 自上一条记录(issuecomment 6333647554,05:40Z:补丁仅有草稿、无推送路径、无运行验证)以来的变化,本轮以只读回访核实如下:
下一轮接续点:① 读回 run 39734373150 等替换提交 CI 的全量结论,若失败则定位 job/日志并记录处置;② 跟随 XuPeng-SH 对新 head 的正式复审状态;③ CI 全绿且无新意见前,保持等待,不自动合并。 |
|
本操作由 LW 授权的 MOI 智能体提交。 补充 PR #1102 head 1. CI 状态(head 26479f6 全部 6 个 run,0 失败,最近 06:55:41 UTC 完成)
2. 对 review 5607566162 两点要求的落证复审(全 diff 复核,7 文件 +400/−18,>Total行数 418 ≤ 1000)
3. 范围超限记录:任务协议限额为每修复 ≤3 文件/≤1000 行;本 PR 因实现 review 5607566162 要求的 vendored crossterm 有效策略方案,必要地触及 7 文件(vendored 补丁+补丁契约文档+vendored 测试+真实渲染器回归+端到端回归+用户文档,不可拆分规避),特此记录,由维护者裁量是否接受方案。 4. 复审状态(如实披露):本运行时未提供独立 review 子代理接口,第 2 节为本智能体对 head 全 diff 的源级复审,不构成独立 review 通过的替代证据;前轮记录的外部"explicitly selected review"为审查证据主线。当前 GitHub 侧 review 决断仍为 Changes Requested。下一步将正式请求 @XuPeng-SH 对 head |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Approve with nits. Reviewed the frozen head 26479f6 without subagents.
The previous requested changes are addressed: the existing PrintStyledContent formatter now applies the effective styling policy to actual tool descriptions, icons, durations, summaries and both spinner workers. The host-only helper and its helper-only regression are gone. The implementation reuses the existing policy cache and force override, adds no renderer policy state or per-site ANSI stripping, and preserves cursor/row-clearing behavior.
Independent local validation passed: 193 relevant CLI tests; 109 vendored tests with 7 existing ignored tests; the actual CLI regression covering colored output, --no-color, nonempty NO_COLOR and empty NO_COLOR; and manual PTY checks observing active normal/grouped stderr and raw stdout worker frames under all three environment policies, including stop/join and active Drop. No blocking correctness, design or performance issue found.
One nonblocking P3 remains: the PTY probe branches have no committed parent driver, so their worker-frame and Drop coverage currently depends on manual QA. See inline comment.
| state.tool_batch_progress = Some((1, 2)); | ||
| let read = json!({"path": "sample.txt"}); | ||
| let idx = state.tool_start("read_file", &read); | ||
| if case.ends_with("-pty") { |
There was a problem hiding this comment.
[P3] Persist the PTY parent driver or remove the manual-only probe branches
The committed parent only enumerates unset/set/empty, and there is no repository caller selecting a -pty case or releasing wait_for_parent(). Consequently ordinary regression runs never execute these waits or the raw stdout animation/active Drop branch below. The CLI fixture sends start/end together and does not explicitly wait for a background worker frame either.
Manual PTY QA passed during this review, so this is nonblocking. Prefer reusing the existing PTY fixture to commit a parent test that observes a worker frame before releasing each phase; otherwise remove the manual-only probe branches and keep the QA procedure reproducible outside the test module. No new test framework is needed.
Capability assessment: Unchanged: correct styling of existing CLI tool progress; no new tools, provider routes, permissions, storage, or deployment profiles.
Summary
--no-colordisabled crossterm color parameters but still left bold, dim, reset and empty SGR sequences in tool progress. The original host-only fix did not reach the actual descriptions, icons, durations, summaries or spinner workers.Use the vendored crossterm formatter's existing effective policy to emit styled content directly when styling is disabled. Treat
NO_COLORpresence, including an empty value, consistently with Astra's Markdown/plain policy. Keep explicitforce_color_outputprecedence. Remove the superseded host helper and its helper-only test; no renderer policy field, per-site sanitizer, or additional global state is added.Related issue
Closes #1045.
Change type
User and compatibility impact
Tool progress, including active spinner text, no longer generates SGR styling with
--no-colororNO_COLORset/empty. Content, glyphs, descriptions, durations and output channels are preserved. Cursor movement, diff row clearing and control bytes already present in content retain their existing contracts; this is not a blanket ANSI sanitizer. No stored-format or configuration migration.Architecture and complexity delta
PrintStyledContentformatter and crossterm effective-policy initialization.StreamRenderStatestart/done/inline/group rendering, theme icons, summaries, diff geometry, both spinner workers and command-router startup.render_headless_stderr_lineplain branch/test, and the superseded dependency test that mutated the parent test process's environment.Verification
Rebased onto
c879afedb6308550ff9a4600893cba3925076dc2.-Zbuild-std,RUSTFLAGS=-Zsanitizer=thread, and instrumented Rust standard library; no race reports or suppressions.cli_pipechecks covered: 20 existing checks passed, and the added CLI test passed separately in four fresh processes (colored control, actual--no-color, set and emptyNO_COLOR). The fixture uses the canonical successful run/tool receipt. Stderr is a real controlling PTY, so automatic pipe suppression cannot make the control pass; piped stdout is asserted to contain only the final answer.cargo clippy --locked -p astra-cli --all-targets -- -D warningspassed; the final public-fixture change was also checked with--test cli_pipe. Standalone vendor all-target lint was compared with the base: the same 3 existing diagnostics in unchangedexamples/stderr.rsandsrc/event/read.rs, with no new diagnostics or lint allowances.git diff --checkpassed.gpt-6.1-sol/xhigh. CI results for the replacement commit are pending; no CI wait or green claim.Final checklist