Skip to content

armgit / Wake

Public Imported from GitHub
0

All your AI agent sessions in one place — browse, search, resume. Rust + GPUI.

Rust

Merge remote-tracking branch 'origin/main' into HEAD

Corey Chiu6958d54a7468
diff --cc CHANGELOG.md
index 3e0d96d,0bd00d6..339a298
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -2,8 -2,12 +2,14 @@@
## Unreleased
+- Fix: in a Codex branch or subagent thread, the parent conversation's transcript is injected as a `user` message — its assistant replies were being shown as if you had typed them, and were indexed for search. They are now treated as injected context, like the other `<environment_context>`-style blocks
+
+ ## [0.3.1] — 2026-08-30
+
+ - Fixed: agent CLI detection now ignores login-shell rc output, including unterminated ANSI title escapes, by parsing only newline-framed Wake probe records
+ - Fixed: agent CLIs installed while Wake is running are detected on the next resume attempt; successful lookups remain cached while misses are re-probed
+ - Fixed: resume errors now identify the missing agent CLI and agent instead of appearing to blame the selected terminal app
+
## [0.3.0] — 2026-08-27
- New: Insights page — a new sidebar entry showing your coding agent activity at a glance: sessions, tokens, prompts, agents, projects, and active days
diff --cc crates/wake-core/tests/adapter_contracts.rs
index 2ba0a08,a087ffd..3a6ed4f
--- a/crates/wake-core/tests/adapter_contracts.rs
+++ b/crates/wake-core/tests/adapter_contracts.rs
@@@ -1721,64 -1714,9 +1721,64 @@@ fn removed_defaults_suppress_instances(
.all(|r| r.starts_with(dir.path())));
}
- /// normalize_custom_root(静态分派,不依赖 roster——该家默认被移除时也要
- /// 生效):codex 直选 sessions 树或**平铺 archived** 且父目录呈 home 形态时
- /// 上提一层(侧档/归档找回,2026-08-24 Codex review);裸拷贝与其他家恒等
+#[test]
+fn codex_subagent_transcript_injection_is_meta() {
+ setup();
+ let adapter = CodexAdapter::new();
+ let r = codex_subagent_ref();
+ let t = adapter
+ .parse_transcript(&r)
+ .expect("codex subagent parse_transcript");
+
+ // 分支 / subagent 线程把**父会话的整段 transcript** 打包成一条
+ // role=user 的消息喂进来,里面含父会话的 assistant 输出。不识别的话,
+ // 父会话里 AI 说的话会显示成这个会话里用户发的
+ let injected = t
+ .mainline
+ .iter()
+ .find(|m| {
+ m.text
+ .starts_with("The following is the Codex agent history")
+ })
+ .expect("注入的 transcript 应当仍在 mainline 里(只是归 Meta)");
+ assert_eq!(injected.kind, MessageKind::Meta);
+ assert!(
+ injected.text.contains("[2] assistant:"),
+ "父会话的 assistant 输出确实躺在这条 role=user 消息里"
+ );
+
+ // AGENTS.md 注入同理
+ let agents_md = t
+ .mainline
+ .iter()
+ .find(|m| m.text.starts_with("# AGENTS.md instructions"))
+ .expect("AGENTS.md 注入");
+ assert_eq!(agents_md.kind, MessageKind::Meta);
+
+ // 真实用户输入不受影响
+ let real = t
+ .mainline
+ .iter()
+ .find(|m| m.text == "继续")
+ .expect("真实用户消息");
+ assert_eq!(real.role, Role::User);
+ assert_eq!(real.kind, MessageKind::Text);
+
+ // Meta 不进 FTS:注入进来的父会话内容不该被搜索命中
+ let s = adapter
+ .parse_session(&r)
+ .expect("codex subagent parse_session");
+ assert!(
+ !s.units.iter().any(|u| u.text.contains("[2] assistant:")),
+ "注入的父会话 transcript 不得进入检索单元"
+ );
+ // 标题也不能取注入内容
+ assert_eq!(s.meta.title, "继续");
+}
+
+ /// normalize_custom_root(静态分派,不依赖 roster——该家默认被移除时也要
+ /// 生效):codex 直选 sessions 树或**平铺 archived** 且父目录呈 home 形态时
+ /// 上提一层(侧档/归档找回,2026-08-24 Codex review);裸拷贝与其他家恒等
#[test]
fn codex_normalize_lifts_sessions_dir_to_home() {
use wake_core::adapters::normalize_custom_root;