-
Notifications
You must be signed in to change notification settings - Fork 3.6k
v0.9.14 slices: #6213 T4/T5, #6244, #6235 #6271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
906f9ac
5d08e45
270c025
7c8fe7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4825,6 +4825,64 @@ fn saved_role_ambiguity_fails_unless_a_higher_priority_pin_selects_the_route() { | |
| assert_eq!(explicit.agent_type, FleetRole::Reviewer); | ||
| } | ||
|
|
||
| /// A prompt-only spawn must not be refused over a role the caller never wrote. | ||
| /// | ||
| /// `request.agent_type` defaults to `FleetRole::Worker`, whose `as_str()` is | ||
| /// `"general"`, so the route lookup synthesized `role:general` for a call that | ||
| /// named no type, role or profile. Two saved members sharing role `general` then | ||
| /// made every bare `agent(action=start, ...)` fail at the tool boundary (#6244). | ||
| /// The refusal is still correct when the caller *did* ask — that half is pinned | ||
| /// by `saved_role_ambiguity_fails_unless_a_higher_priority_pin_selects_the_route`. | ||
| #[test] | ||
| fn prompt_only_spawn_survives_an_ambiguous_default_role() { | ||
| let root = tempdir().unwrap(); | ||
| for id in ["general-a", "general-b"] { | ||
| std::fs::write( | ||
| root.path().join(format!("{id}.toml")), | ||
| format!( | ||
| "id = '{id}'\nbase_role = 'general'\nprovider = 'deepseek'\nmodel = 'deepseek-v4-flash'\n", | ||
| ), | ||
| ) | ||
| .unwrap(); | ||
| } | ||
| let profiles = crate::fleet::profile::load_agent_profiles_from_dir(root.path()).unwrap(); | ||
| assert_eq!(profiles.len(), 2); | ||
| let roster = FleetRoster::from_members(profiles); | ||
| let runtime = stub_runtime(); | ||
|
|
||
| let mut request = parse_spawn_request(&json!({"prompt":"do the thing"})).unwrap(); | ||
| assert!( | ||
| !request.agent_type_explicit, | ||
| "a prompt-only spawn must not report an explicit type" | ||
| ); | ||
| assert_eq!(request.assignment.role, None); | ||
|
|
||
| let member = resolve_spawn_route_profile(&runtime, &mut request, &roster) | ||
| .expect("an ambiguous default role must not block a prompt-only spawn"); | ||
| assert!( | ||
| member.is_none(), | ||
| "no member is pinned, so the spawn falls through to the session route" | ||
| ); | ||
| assert_eq!( | ||
| request.profile, None, | ||
| "an unusable pin must not stamp a member" | ||
| ); | ||
|
|
||
| // The same roster still refuses when the caller actually named the role. | ||
| let mut asked = parse_spawn_request(&json!({"prompt":"do the thing", "type":"general"})) | ||
| .expect("an explicit general type parses"); | ||
| if asked.agent_type_explicit { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [INFO] New #6244 test can silently skip the 'explicit role still refuses' half of its property
|
||
| let error = resolve_spawn_route_profile(&runtime, &mut asked, &roster) | ||
| .expect_err("an explicitly requested ambiguous role must still refuse"); | ||
| let message = error.to_string(); | ||
| assert!(message.contains("ambiguous"), "{message}"); | ||
| assert!( | ||
| message.contains("profile"), | ||
| "the refusal must say how to choose one: {message}" | ||
| ); | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make the refusal half unconditional, or assert the precondition explicitly, so the assertion cannot disappear when |
||
| } | ||
|
|
||
| #[test] | ||
| fn providerless_spawn_model_gate_rejects_known_foreign_route_before_spawn() { | ||
| let runtime = stub_runtime_for_provider("moonshot"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[INFO] Ambiguous-selector error message now prescribes
profile, which is not the parameter for every callerThe reworded
FleetSelectorError::Ambiguousmessage tells the user to choose a member 'by passingprofileas one of: {candidates}'.resolve_member_in_profiles(the function that produces this variant) is documented as the entry point for Fleet task dispatch as well, where the selector is an identity string and there is noprofileargument to pass; only theagent(action=start)path introduced by this PR has one. Callers on the dispatch path now get a fix instruction that names a parameter that does not exist there. Message-only, no control-flow impact.