Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/crates/adapters/ai-adapters/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ run the subscription-auth command below after changing those interpretations.
```bash
cargo test -p openbitfun-agent-stream
cargo test -p openbitfun-ai-adapters
cargo test --locked -p openbitfun-ai-adapters --lib client::healthcheck::tests
cargo test --locked -p openbitfun-ai-adapters --lib providers::anthropic::request::tests
cargo test -p openbitfun-ai-adapters --lib opencode_catalog
cargo test --locked -p openbitfun-ai-adapters --lib providers::opencode::tests
Expand Down
1 change: 1 addition & 0 deletions src/crates/adapters/ai-adapters/src/client/healthcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ mod tests {
format: "openai".into(),
context_window: 65_536,
max_tokens: Some(128),
max_images_per_request: None,
temperature: None,
top_p: None,
inline_think_in_text: false,
Expand Down
10 changes: 10 additions & 0 deletions src/crates/assembly/core/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,16 @@ them under `product-full`. `PathManager::with_user_root_for_tests` derives produ
home from the user root's parent, so a fixture that relocates managed paths must
place its user root below the directory it means to exercise.

For cold dialog startup and the production-feature scheduler stack regression:

```bash
cargo test --locked -p openbitfun-core --features product-full --lib agentic::coordination::scheduler::tests::idle_background_result_uses_the_session_logical_agent_route -- --exact
```

Run this filter alone with `RUST_MIN_STACK` unset so prior skill discovery cannot
warm the cold-start path. The shared coordinator keeps startup state behind one
allocation boundary for every admission surface.

For direct user follow-ups to reusable subagent sessions, legacy route defaults,
source binding, and FreshOnly admission:

Expand Down
39 changes: 38 additions & 1 deletion src/crates/assembly/core/src/agentic/coordination/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6435,7 +6435,44 @@ Update the persona files and delete BOOTSTRAP.md as soon as bootstrap is complet
}

#[allow(clippy::too_many_arguments)]
async fn start_dialog_turn_internal(
fn start_dialog_turn_internal(
&self,
session_id: String,
user_input: String,
original_user_input: Option<String>,
image_contexts: Option<Vec<ImageContextData>>,
turn_id: Option<String>,
agent_type: String,
workspace_path: Option<String>,
remote_connection_id: Option<String>,
remote_ssh_host: Option<String>,
submission_policy: DialogSubmissionPolicy,
extra_user_message_metadata: Option<serde_json::Value>,
additional_prepended_messages: Vec<Message>,
suppress_session_title_generation: bool,
) -> futures::future::BoxFuture<'_, OpenBitFunResult<()>> {
// All admission surfaces share this allocation boundary. Keeping the
// startup state inline multiplies debug poll temporaries in the public
// wrappers and scheduler, exhausting the stack during cold skill initialization.
Box::pin(self.start_dialog_turn_internal_impl(
session_id,
user_input,
original_user_input,
image_contexts,
turn_id,
agent_type,
workspace_path,
remote_connection_id,
remote_ssh_host,
submission_policy,
extra_user_message_metadata,
additional_prepended_messages,
suppress_session_title_generation,
))
}

#[allow(clippy::too_many_arguments)]
async fn start_dialog_turn_internal_impl(
&self,
session_id: String,
user_input: String,
Expand Down
32 changes: 23 additions & 9 deletions src/crates/assembly/core/src/service_agent_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4412,33 +4412,47 @@ mod tests {
}

#[test]
fn remote_model_strategy_guard_distinguishes_legacy_children_from_smart_main_sessions() {
fn remote_model_strategy_guard_preserves_stored_intent_in_closed_release() {
use crate::agentic::core::SessionConfig;
use crate::agentic::execution::round_model_routing::configuration::available;

assert!(!available());

let mut session = Session::new(
"Model selection".into(),
"Standard".into(),
SessionConfig {
model_id: Some("saved-model".into()),
model_routing: Some("manual".into()),
model_routing: Some("smart".into()),
..Default::default()
},
);
assert!(ensure_remote_model_strategy_editable(&session).is_ok());
session.config.model_routing = Some("smart".into());

// Persisted Smart intent must not block explicit model selection while
// routing is unavailable, or be rewritten by this read-only guard.
for mode in [None, Some("manual"), Some("smart")] {
session.config.model_routing = mode.map(str::to_owned);
let before = serde_json::to_value(&session).unwrap();
assert_eq!(ensure_remote_model_strategy_editable(&session), Ok(()));
assert_eq!(serde_json::to_value(&session).unwrap(), before);
}

session.config.model_routing = Some("future-mode".into());
let before = serde_json::to_value(&session).unwrap();
assert!(ensure_remote_model_strategy_editable(&session)
.unwrap_err()
.contains("Smart routing is active"));
.contains("Unsupported model routing strategy"));
assert_eq!(serde_json::to_value(&session).unwrap(), before);

session.kind = SessionKind::Subagent;
session.config.delegation_model_routing = Some("smart".into());
for mode in ["smart", "manual", "future-mode"] {
session.config.model_routing = Some(mode.into());
let before = serde_json::to_value(&session.config).unwrap();
for mode in [None, Some("smart"), Some("manual"), Some("future-mode")] {
session.config.model_routing = mode.map(str::to_owned);
let before = serde_json::to_value(&session).unwrap();
let error = ensure_remote_model_strategy_editable(&session).unwrap_err();
assert!(error.contains("Subagent models are configured independently"));
assert!(!error.contains("Smart routing is active"));
assert_eq!(serde_json::to_value(&session.config).unwrap(), before);
assert_eq!(serde_json::to_value(&session).unwrap(), before);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/web-ui/src/locales/en-US/scenes/capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@
"available-models": "Let an agent inspect models available under the current configuration",
"model-catalog": "Inspect models.dev catalog status, refresh it manually, and reveal its local cache",
"advanced-request": "Add custom headers, request-body fields, and SSL behavior per provider",
"smart-routing": "View smart-mode availability (not available yet)",
"connection-test": "Test model connections or image generation and refresh the runtime client",
"model-pools": "Manage model pools, routing strategies, and session model selection"
}
Expand Down
1 change: 1 addition & 0 deletions src/web-ui/src/locales/zh-CN/scenes/capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@
"available-models": "让智能体查看当前配置下可用的模型",
"model-catalog": "查看 models.dev 目录状态、手动刷新并定位本地缓存",
"advanced-request": "为供应商添加自定义 Header、请求体字段与 SSL 行为",
"smart-routing": "查看智能模式可用状态(暂未开放)",
"connection-test": "测试模型连接或图像生成,并刷新运行时客户端",
"model-pools": "管理模型池、路由策略与会话模型选择"
}
Expand Down
1 change: 1 addition & 0 deletions src/web-ui/src/locales/zh-TW/scenes/capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@
"available-models": "讓智能體查看當前配置下可用的模型",
"model-catalog": "查看 models.dev 目錄狀態、手動重新整理並定位本地緩存",
"advanced-request": "為供應商添加自定義 Header、請求體字段與 SSL 行為",
"smart-routing": "查看智慧模式可用狀態(暫未開放)",
"connection-test": "測試模型連線或圖像生成,並重新整理執行階段用戶端",
"model-pools": "管理模型池、路由策略與工作階段模型選擇"
}
Expand Down
Loading