Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
48d2cee
refactor(runtime): fold Agent creation and restore into options
yyhhyyyyyy Nov 25, 2026
674789c
refactor(runtime): name a prepared creation's Session once
yyhhyyyyyy Nov 25, 2026
d284776
fix(runtime): validate an explicit Session id before creating
yyhhyyyyyy Nov 25, 2026
743ae6b
fix(runtime): keep the existing Session's state when a duplicate is r…
yyhhyyyyyy Nov 25, 2026
2bbc7cd
test(runtime): compare the existing stored rows across a rejected dup…
yyhhyyyyyy Nov 25, 2026
570cc8f
fix(runtime): book a Session id's output name before creating
yyhhyyyyyy Nov 25, 2026
d81f37d
test(runtime): release a failed creation's booked name
yyhhyyyyyy Nov 25, 2026
bdc21bc
fix(runtime): reserve the id bookings' name as a Session id
yyhhyyyyyy Nov 25, 2026
cc6a1c1
test(app-server): cover the booking a delete removes
yyhhyyyyyy Nov 25, 2026
eb4ca48
docs(runtime): state what the Session id booking covers
yyhhyyyyyy Nov 25, 2026
361480a
fix(runtime): reserve the id bookings' name as Windows folds it
yyhhyyyyyy Nov 25, 2026
88b81d6
style(runtime): wrap the reserved id spellings
yyhhyyyyyy Nov 25, 2026
d35c923
style(runtime): trim the reserved name with a pattern
yyhhyyyyyy Nov 25, 2026
69c1133
docs(runtime): wrap the booking paragraph
yyhhyyyyyy Nov 25, 2026
d41af6a
docs(runtime): narrow what a Session id booking protects
yyhhyyyyyy Nov 25, 2026
775a873
test(app-server): book a deleted name with an empty directory
yyhhyyyyyy Nov 25, 2026
bef532a
fix(runtime): reserve the booking name under Unicode case folding
yyhhyyyyyy Nov 25, 2026
5a7a60c
test(runtime): refuse the folding spellings of the booking name
yyhhyyyyyy Nov 25, 2026
d43ba13
docs(runtime): narrow the reserved name to its folding
yyhhyyyyyy Nov 25, 2026
6867cb6
revert(runtime): withdraw the Session id booking
yyhhyyyyyy Nov 25, 2026
fe40ba4
refactor(runtime): generate the plain creation's Session id
yyhhyyyyyy Nov 26, 2026
21dd75a
Merge remote-tracking branch 'origin/main' into hui/agent-create-base4-2
yyhhyyyyyy Nov 26, 2026
418f6ed
test(integration): pass the Session options in the environment flows
yyhhyyyyyy Nov 26, 2026
08b73bf
docs(capabilities): pass creation options in the README example
yyhhyyyyyy Nov 26, 2026
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
52 changes: 39 additions & 13 deletions crates/dim-agent-aimux/tests/model_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ async fn native_http_text_usage_tools_and_continuation_follow_agent_events() {
tokio::time::timeout(Duration::from_secs(15), async {
let server = TestServer::start().await;
let agent = model_agent(server.models(), None).await;
let session = agent.create_session(session_config()).await.unwrap();
let session = agent.create_session(session_config(), Default::default()).await.unwrap();
session.submit("text".into(), InputMode::Queue, "main").await.unwrap();
session.idle("main").await.unwrap();
let events = chain_events(&session, "main", ..).await.unwrap();
Expand Down Expand Up @@ -512,7 +512,7 @@ async fn native_http_text_usage_tools_and_continuation_follow_agent_events() {
"sessionId": "stale-session", "turnId": "stale-turn", "requestId": "stale-request",
"runId": "caller-run", "traceId": "caller-trace", "experiment": "selected"
})).unwrap());
let selected = agent.create_session(explicit).await.unwrap();
let selected = agent.create_session(explicit, Default::default()).await.unwrap();
selected.submit("text".into(), InputMode::Queue, "main").await.unwrap();
selected.idle("main").await.unwrap();
let events = chain_events(&selected, "main", ..).await.unwrap();
Expand Down Expand Up @@ -545,7 +545,10 @@ async fn chat_usage_without_details_records_cache_read_as_unknown() {
tokio::time::timeout(Duration::from_secs(15), async {
let server = TestServer::start().await;
let agent = model_agent(server.models(), None).await;
let session = agent.create_session(session_config()).await.unwrap();
let session = agent
.create_session(session_config(), Default::default())
.await
.unwrap();
session
.submit("usage-nodetails".into(), InputMode::Queue, "main")
.await
Expand Down Expand Up @@ -577,7 +580,10 @@ async fn chat_reasoning_tokens_reach_the_recorded_usage() {
tokio::time::timeout(Duration::from_secs(15), async {
let server = TestServer::start().await;
let agent = model_agent(server.models(), None).await;
let session = agent.create_session(session_config()).await.unwrap();
let session = agent
.create_session(session_config(), Default::default())
.await
.unwrap();
session
.submit("usage-reasoning".into(), InputMode::Queue, "main")
.await
Expand Down Expand Up @@ -623,7 +629,10 @@ async fn protocol_session(
};
let models = Arc::new(AimuxModels::from_config(configuration_of(&base, kind)).unwrap());
let agent = model_agent(models, None).await;
let session = agent.create_session(session_config()).await.unwrap();
let session = agent
.create_session(session_config(), Default::default())
.await
.unwrap();
(agent, session)
}

Expand All @@ -645,7 +654,10 @@ async fn chat_without_details_records_no_reasoning_count() {
tokio::time::timeout(Duration::from_secs(15), async {
let server = TestServer::start().await;
let agent = model_agent(server.models(), None).await;
let session = agent.create_session(session_config()).await.unwrap();
let session = agent
.create_session(session_config(), Default::default())
.await
.unwrap();
session
.submit("usage-nodetails".into(), InputMode::Queue, "main")
.await
Expand All @@ -667,7 +679,10 @@ async fn chat_with_a_zero_reasoning_count_records_zero() {
tokio::time::timeout(Duration::from_secs(15), async {
let server = TestServer::start().await;
let agent = model_agent(server.models(), None).await;
let session = agent.create_session(session_config()).await.unwrap();
let session = agent
.create_session(session_config(), Default::default())
.await
.unwrap();
session
.submit("usage-zero".into(), InputMode::Queue, "main")
.await
Expand Down Expand Up @@ -735,7 +750,7 @@ async fn interrupt_releases_native_request_and_keeps_other_branches_usable() {
tokio::time::timeout(Duration::from_secs(15), async {
let server = TestServer::start().await;
let agent = model_agent(server.models(), None).await;
let session = agent.create_session(session_config()).await.unwrap();
let session = agent.create_session(session_config(), Default::default()).await.unwrap();
session.submit("wait".into(), InputMode::Queue, "main").await.unwrap();
// Streaming text is progress until its block ends (agent-029).
while !session.get::<dim_agent_runtime::ModelProgress>("main").unwrap().is_some_and(|progress| !progress.text.is_empty()) {
Expand All @@ -758,7 +773,7 @@ async fn failed_native_outputs_do_not_execute_tools_or_invent_usage() {
let server = TestServer::start().await;
let agent = model_agent(server.models(), None).await;
for prompt in ["unauthorized", "truncated", "length"] {
let session = agent.create_session(session_config()).await.unwrap();
let session = agent.create_session(session_config(), Default::default()).await.unwrap();
session.submit(prompt.into(), InputMode::Queue, "main").await.unwrap();
session.idle("main").await.unwrap();
let events = chain_events(&session, "main", ..).await.unwrap();
Expand All @@ -777,7 +792,12 @@ async fn model_configuration_rejects_unknown_models_before_session_start() {
let agent = model_agent(server.models(), None).await;
let mut config = session_config();
config.model.model_id = "not-registered".into();
assert!(agent.create_session(config).await.is_err());
assert!(
agent
.create_session(config, Default::default())
.await
.is_err()
);
assert!(agent.sessions().is_empty());
assert!(server.endpoint.requests.lock().unwrap().is_empty());
agent.close().await.unwrap();
Expand Down Expand Up @@ -1030,7 +1050,7 @@ async fn before_committed_request_controls_model_settings_and_tool_admission() {
let mut builder = builder(models.clone(), Arc::new(MockTools));
builder.require_feature(Feature::new("test.final-model-request").branch("test.final-model-request", move |names| Ok(Box::new(OverrideRequest { remove_tools, timeline: names.key()? }))));
let agent = model_agent(models.clone(), Some(builder)).await;
let session = agent.create_session(session_config()).await.unwrap();
let session = agent.create_session(session_config(), Default::default()).await.unwrap();
session.submit("tool".into(), InputMode::Queue, "main").await.unwrap();
session.idle("main").await.unwrap();
let events = chain_events(&session, "main", ..).await.unwrap();
Expand Down Expand Up @@ -1234,7 +1254,10 @@ async fn recorded_requests_write_their_wire_exchange() {
let recording = Recording::start().await;
let server = TestServer::start().await;
let agent = model_agent(server.models(), None).await;
let session = agent.create_session(session_config()).await.unwrap();
let session = agent
.create_session(session_config(), Default::default())
.await
.unwrap();
session
.submit("text".into(), InputMode::Queue, "main")
.await
Expand Down Expand Up @@ -1604,7 +1627,10 @@ async fn a_same_origin_307_or_308_redirect_completes_the_turn_at_its_target() {
] {
let server = RedirectServer::start(status, "/v1b/chat/completions").await;
let agent = model_agent(server.models(), None).await;
let session = agent.create_session(session_config()).await.unwrap();
let session = agent
.create_session(session_config(), Default::default())
.await
.unwrap();
session
.submit("text".into(), InputMode::Queue, "main")
.await
Expand Down
Loading