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
11 changes: 10 additions & 1 deletion apps/maple-agent/crates/maple-agent/src/acp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,16 @@ impl AcpConnectionContext {
"reasoningEfforts": state
.levels
.iter()
.map(|level| serde_json::json!({"value": level.as_str()}))
// `id` and `label` as well as `value`: clients
// differ on which key they read, and one that
// requires an absent key drops the whole list.
.map(|level| {
serde_json::json!({
"id": level.as_str(),
"value": level.as_str(),
"label": level.as_str(),
})
})
.collect::<Vec<_>>(),
"reasoningEffort": state.current.as_str(),
}),
Expand Down
5 changes: 5 additions & 0 deletions apps/maple-agent/crates/maple-agent/src/acp/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,11 @@ async fn session_setup_reports_every_models_reasoning_levels() {
let reasoner = meta_of(&created["models"], "reasoner");
assert_eq!(levels_of(&reasoner), ["off", "low", "high", "max"]);
assert_eq!(reasoner["reasoningEffort"], "high");
// Each level carries the same name under every key a client may read.
assert_eq!(
reasoner["reasoningEfforts"][0],
json!({"id": "off", "value": "off", "label": "off"})
);
let always_on = meta_of(&created["models"], "always-on");
assert_eq!(levels_of(&always_on), ["low", "high"]);
assert_eq!(always_on["reasoningEffort"], "low");
Expand Down
1 change: 1 addition & 0 deletions apps/maple-agent/docs/local-host.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ request on the same connection, opened with `mcp/connect` and closed with
The `model` config option stays the selector; `models.availableModels[]` lists
the same models with each one's reasoning levels in `_meta`
(`reasoningEfforts` and `reasoningEffort`, or `supportsReasoningEffort: false`),
each effort naming its level as `id`, `value` and `label`,
read from the state the `thought_level` option shows for that model. A client
that probes one session thus learns every model's levels.

Expand Down
Loading