Synced from monorepo
Synced from monorepo Changes: - Workspace server: surface preview-proxy metrics through the hub metric pump - Shell: reclaim a session’s retained state in one entry - Shell: reclaim a session’s resident state in one entry - Pager: withhold key event types from Alacritty builds that double keys - Tools: cancel a session’s subagents when it closes - Pager: keep the whole plan in scrollback and separate reasoning from output in minimal mode - Pager: probe terminal version over DA2 and include it with feedback - SuperGrok Plus: identity, CLI, and analytics tier surfaces - Shell: inherit the session process scope into subagents - Pager: build @-file-search matcher lazily on first use - Tools: fix description and output contradictions in tool definitions - Workspace: degrade @-file-search instead of aborting on thread exhaustion - Tools: reap a session’s LSP servers when it closes - Tools: fix contradictions and defects in tool descriptions, schemas, and harness pools - MCP: reap stdio MCP children on session close - Shell: reuse spawn-time skill discovery for session telemetry - Tools: stop leaking shell-wrapper positional params into sourced scripts (fixes activate_conda under persistent/static shell) - Shell: self-heal corrupt session-search SQLite cache - Workspace: cap workspace-server tokio workers on many-core hosts - Shell: reap a session’s child processes when it closes - Crash handler: capture SIGABRT so panic-aborts leave crash reports - CLI chat proxy: team-scoped Grok Code managed-config admin routes - MCP: add CLI enable/disable for MCP servers - Shell: cap tokio worker threads for startup thread demand - Workspace: harden git_commit and add git_sync_base operation - Circuit breaker: add feature-gated gRPC retry policy Source-Revision: 2a818575225183d8ca915f5632a09b8067b5156a
This commit is contained in:
parent
02d9359435
commit
5da6962e4a
192 changed files with 10337 additions and 3421 deletions
|
|
@ -1568,6 +1568,64 @@ mod tests {
|
|||
"should state the resumed agent must match subagent_type"
|
||||
);
|
||||
}
|
||||
/// The bridge's full-discovery snapshot must record every discovered
|
||||
/// skill name — including `paths:`-gated and preloaded skills that the
|
||||
/// listing baseline (`slash_skills`) holds back — so session-start
|
||||
/// telemetry can reuse it instead of re-walking the disk.
|
||||
#[tokio::test]
|
||||
async fn discovery_snapshot_records_gated_and_preloaded_skills() {
|
||||
use xai_grok_tools::computer::local::LocalTerminalBackend;
|
||||
use xai_grok_tools::notification::ToolNotificationHandle;
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let write_skill = |dir: &str, content: &str| {
|
||||
let d = tmp.path().join(".grok/skills").join(dir);
|
||||
std::fs::create_dir_all(&d).unwrap();
|
||||
std::fs::write(d.join("SKILL.md"), content).unwrap();
|
||||
};
|
||||
write_skill(
|
||||
"snapshot-plain-skill",
|
||||
"---\nname: snapshot-plain-skill\ndescription: plain\n---\nbody\n",
|
||||
);
|
||||
write_skill(
|
||||
"snapshot-gated-skill",
|
||||
"---\nname: snapshot-gated-skill\ndescription: gated\npaths: \"src/**\"\n---\nbody\n",
|
||||
);
|
||||
let mut definition = crate::config::AgentDefinition::default_grok_build();
|
||||
definition.skills = vec!["snapshot-plain-skill".to_string()];
|
||||
let agent = AgentBuilder::new(
|
||||
tmp.path().to_path_buf(),
|
||||
Arc::new(LocalTerminalBackend::new()),
|
||||
ToolNotificationHandle::noop(),
|
||||
)
|
||||
.from_definition(definition)
|
||||
.build()
|
||||
.await
|
||||
.expect("agent should build with local skill fixtures");
|
||||
let snapshot = agent.tool_bridge().skill_discovery_snapshot_names().await;
|
||||
assert!(
|
||||
snapshot.contains(&"snapshot-plain-skill".to_string()),
|
||||
"preloaded skill missing from snapshot: {snapshot:?}"
|
||||
);
|
||||
assert!(
|
||||
snapshot.contains(&"snapshot-gated-skill".to_string()),
|
||||
"paths:-gated skill missing from snapshot: {snapshot:?}"
|
||||
);
|
||||
let listed: Vec<String> = agent
|
||||
.tool_bridge()
|
||||
.slash_skills()
|
||||
.await
|
||||
.into_iter()
|
||||
.map(|s| s.name)
|
||||
.collect();
|
||||
assert!(
|
||||
!listed.contains(&"snapshot-gated-skill".to_string()),
|
||||
"paths:-gated skill must stay out of the listing baseline: {listed:?}"
|
||||
);
|
||||
assert!(
|
||||
!listed.contains(&"snapshot-plain-skill".to_string()),
|
||||
"preloaded skill must stay out of the listing baseline: {listed:?}"
|
||||
);
|
||||
}
|
||||
async fn build_pager_agent(
|
||||
profile: crate::config::AgentDefinition,
|
||||
subagents_enabled: bool,
|
||||
|
|
|
|||
Loading…
Reference in a new issue