omx(team): auto-checkpoint worker-1 [1]

This commit is contained in:
bellman
2026-05-15 10:05:41 +09:00
parent 9910d5805e
commit 4a76632f6c
4 changed files with 27 additions and 6 deletions

View File

@@ -1617,7 +1617,8 @@ mod tests {
"stdio-server": {
"command": "uvx",
"args": ["mcp-server"],
"env": {"TOKEN": "secret"}
"env": {"TOKEN": "secret"},
"required": true
},
"remote-server": {
"type": "http",
@@ -1666,6 +1667,7 @@ mod tests {
.get("stdio-server")
.expect("stdio server should exist");
assert_eq!(stdio_server.scope, ConfigSource::User);
assert!(stdio_server.required);
assert_eq!(stdio_server.transport(), McpTransport::Stdio);
let remote_server = loaded
@@ -1673,6 +1675,7 @@ mod tests {
.get("remote-server")
.expect("remote server should exist");
assert_eq!(remote_server.scope, ConfigSource::Local);
assert!(!remote_server.required);
assert_eq!(remote_server.transport(), McpTransport::Ws);
match &remote_server.config {
McpServerConfig::Ws(config) => {

View File

@@ -117,7 +117,7 @@ pub fn scoped_mcp_config_hash(config: &ScopedMcpServerConfig) -> String {
format!("claudeai-proxy|{}|{}", proxy.url, proxy.id)
}
};
stable_hex_hash(&rendered)
stable_hex_hash(&format!("required:{}|{rendered}", config.required))
}
fn render_command_signature(command: &[String]) -> String {

View File

@@ -2726,7 +2726,7 @@ mod tests {
(
"broken".to_string(),
ScopedMcpServerConfig {
required: false,
required: true,
scope: ConfigSource::Local,
config: McpServerConfig::Stdio(McpStdioServerConfig {
command: broken_script_path.display().to_string(),
@@ -2748,6 +2748,7 @@ mod tests {
);
assert_eq!(report.failed_servers.len(), 1);
assert_eq!(report.failed_servers[0].server_name, "broken");
assert!(report.failed_servers[0].required);
assert_eq!(
report.failed_servers[0].phase,
McpLifecyclePhase::InitializeHandshake
@@ -2768,6 +2769,14 @@ mod tests {
assert_eq!(degraded.working_servers, vec!["alpha".to_string()]);
assert_eq!(degraded.failed_servers.len(), 1);
assert_eq!(degraded.failed_servers[0].server_name, "broken");
assert_eq!(
degraded.failed_servers[0]
.error
.context
.get("required")
.map(String::as_str),
Some("true")
);
assert_eq!(
degraded.failed_servers[0].phase,
McpLifecyclePhase::InitializeHandshake
@@ -2803,7 +2812,7 @@ mod tests {
(
"http".to_string(),
ScopedMcpServerConfig {
required: false,
required: true,
scope: ConfigSource::Local,
config: McpServerConfig::Http(McpRemoteServerConfig {
url: "https://example.test/mcp".to_string(),
@@ -2842,11 +2851,14 @@ mod tests {
assert_eq!(unsupported.len(), 3);
assert_eq!(unsupported[0].server_name, "http");
assert!(unsupported[0].required);
assert_eq!(unsupported[1].server_name, "sdk");
assert_eq!(unsupported[2].server_name, "ws");
let failed = unsupported_server_failed_server(&unsupported[0]);
assert_eq!(failed.phase, McpLifecyclePhase::ServerRegistration);
assert_eq!(
unsupported_server_failed_server(&unsupported[0]).phase,
McpLifecyclePhase::ServerRegistration
failed.error.context.get("required").map(String::as_str),
Some("true")
);
}