Repository navigation
feat(collaboration): clarify agent profile fields and request/message semantics - #2214
Conversation
… systemPrompt optional The leader's agent schema required profile.tools and profile.systemPrompt and described none of the profile fields, so a leader had to invent a tool list for every temporary member. Unresolved names were dropped silently and surfaced later as "Unknown tool" in the member. - profile.tools is optional; omitted, the member mounts the full tool set. - profile.systemPrompt is optional in AgentProfile and the schema; omitted, the member gets no dim/session role instructions. - Field descriptions state what each field is for: name is how the user knows the Agent, description is its purpose, systemPrompt is standing guidance that lasts the Agent's life, prompt is the task the member sees instead of the leader's conversation. - The request bullet says members cannot delegate and that tools are usually omitted.
5a2d71f to
25f270b
Compare
zerob13
left a comment
There was a problem hiding this comment.
Reviewed 25f270be8707abc618f5f7878d4ee7516e6a0240. Making systemPrompt optional preserves the empty-profile behavior and storage format. Two areas need resolution before merge:
- Make the temporary-member tool default an explicit product decision. Today's leader schema asks for a list; this change both removes that requirement and recommends omission. When the leader has a narrower mount list, an omitted list gives the new member its own full Session declarations, which can include tools absent from the leader. Inherited Permission and Approval still apply; this is a declaration-default change, not an authorization bypass. Keep an explicit choice or confirm the wider default and verify the first temporary member model request for both omission and an explicit empty list. This does not ask for a new global leader-to-member cap. Leader schema · Mount contract
- Keep new model policy replaceable and evaluated. A candidate that replaces
leader_descriptionstill receives the hard-coded naming and role-prompt recommendations in the schema. Keep the new descriptions factual, or make the recommendations replaceable through the shipped factory and provide the policy comparison against current behavior. Verify the candidate is the guidance actually delivered in the model request. Schema and selection · Model-prompt contract
Local agent-types and targeted transport tests passed. The declaration and policy findings are static. Exact-pair hosted CI is separate.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope. This PR makes profile.tools and profile.systemPrompt optional in the leader's agent schema, describes the profile fields and prompt, adds #[serde(default)] to AgentProfile.system_prompt, and updates the Collaboration classification tables.
Semantics verified. Omitted profile.tools becomes SessionConfig.tools = None (crates/dim-app-server/src/agents.rs:76), and ToolRegistry then declares every host tool, every registered tool and every source tool (crates/dim-agent-capabilities/src/tool_registry.rs:318-343). That is the process-wide callable set, not the leader's set, and nothing caps it. The member copies the leader's permission policy (docs/design/subagent-tool-approval.md:23-36) and Permission admits each call, so I found no authorization escalation, but the uncapped choice is not stated as a known limitation. An omitted systemPrompt becomes "", and session_entry returns no entry for empty text (crates/dim-agent-capabilities/src/prompt_sources.rs:147-156), on creation and on session.agent.update (crates/dim-app-server/src/agents/configuration.rs:301). AgentProfile still serializes systemPrompt because the field has no skip_serializing_if (crates/dim-agent-types/src/profile.rs:17-18), so stored records carry it, as the body says. Unresolved mount-list names are still dropped with a debug log (crates/dim-agent-capabilities/src/tool_registry.rs:438-444).
Blocking (P2), design contract. The new schema row marks two schema property descriptions as Policy, while the same page's section 3 says policy is the guidance in the two descriptions and only leader_description and member_description are factory configuration members (docs/design/plugins/Collaboration.md:15 vs :45; crates/dim-app-server/src/collaboration.rs:96-101, :3413-3420). docs/design/model-prompts.md:203 requires every policy text at the author's factory configuration, and :168 forbids patching strings in an evaluation-only path. A candidate change to those hints cannot run through the shipped assembly. Fix in the inline comment on the design row.
P3, test gap. The new bare profile proves acceptance only. No test asserts that omitted tools mounts the full set or that omitted systemPrompt adds no role prompt, so the new schema promises have no behavioral test. See the inline comment on agents.rs.
P3, type doc. The final head removed the system_prompt doc comment. The public type no longer states that omission is accepted or that empty means no role prompt. See the inline comment on profile.rs.
Cross-PR. git merge-tree is clean against origin/main c68dad5 and the current heads of #2174 1ed1352, #2197 76a945c (the brief's 76f722f is an ancestor of it) and #2206 45c02dd. One semantic note with #2197: it sets a new member's tool_mode from the leader's chosen mode and projects declarations by mode, so once it lands "the full tool set" should be read as the callable set, and a member can run a mode that a narrowed leader's own mount list cannot. Nothing to change here now; recheck that wording when #2197 lands.
Verification. cargo test --locked -p dim-app-server --test transport_flow -- agents:: collaboration::: 74 passed, 0 failed, 1 ignored. cargo test --locked -p dim-agent-types: 48 passed. node scripts/adr-check.mjs --base origin/main: passed. CI at 25f270b: macos-native and windows-cli passed, verify (linux) was still in progress, static-checks and scripts were skipped. No residual test processes.
| | --- | --- | | ||
| | `agent` declaration, schema | Protocol: the actions each role may call, `agentId`, `sessionId`, `content`, `mode`, `after`, `branchId`, `limit`, `resultId`, `prompt`, `title` and the `profile` object. A leader gets `models` only where the deployment provides Provider's selectable-model read (§7) | | ||
| | `agent` declaration, description | Protocol: every sentence that states what an action does or what the runtime guarantees — the request/cancel/close/message/read/list/inspect/models/result bullets, "Returns immediately; the member's final result arrives later as an input.", "One task per member at a time.", "The user's subagent model policy may override the model a new member's profile requests.", and the `append` mode's "adds context the receiver sees in its next step without interrupting it". Policy: "Use mode \"steer\" only when the receiver must change course now.", "Address members with agentId + sessionId from earlier results.", and the member text's "do not send it as a message" | | ||
| | `agent` declaration, schema | Protocol: the actions each role may call, `agentId`, `sessionId`, `content`, `mode`, `after`, `branchId`, `limit`, `resultId`, `prompt`, `title` and the `profile` object, whose `systemPrompt` is optional and, omitted, adds no role instructions, and whose `tools` is optional and, omitted, mounts the full tool set. A leader gets `models` only where the deployment provides Provider's selectable-model read (§7). Policy: `profile.name`'s "A person's name that fits the user's language and region works well." and `profile.systemPrompt`'s "use it only when the role truly needs that" | |
There was a problem hiding this comment.
P2, design contract. This row marks two schema property descriptions as Policy, but line 45 of this page says policy is the guidance in the two descriptions and only leader_description and member_description are factory configuration members (crates/dim-app-server/src/collaboration.rs:96-101). The schema strings are hardcoded in agent_definition (crates/dim-app-server/src/collaboration.rs:3413-3420) and cannot be replaced by either member. docs/design/model-prompts.md:203 requires every policy text to be exposed at the author's factory configuration so a candidate runs through the shipped assembly, and docs/design/model-prompts.md:168 forbids patching strings in an evaluation-only path.
Failure scenario. A candidate change to "A person's name that fits the user's language and region works well." or "use it only when the role truly needs that" cannot be evaluated as model-prompts section 8 requires: an assembly that sets leader_description still carries the built-in schema hints, so the candidate arm never runs the candidate text. A reader of section 3 also concludes that only the descriptions are policy and can edit the schema hints without the evaluation.
Fix. Keep the schema to protocol facts and move the guidance into leader_description, which is already factory configured; or add a factory member for the schema hints and update section 3 and collaborationConfig. If the schema text is meant to be protocol (docs/design/model-prompts.md:70), then remove the Policy label and mark it protocol consistently. The PR body says the tools, name and systemPrompt hints are Policy, but this schema row lists only the name and systemPrompt hints; the schema's "To narrow it..." tools hint is listed under neither class. The zh row (docs/zh/design/plugins/Collaboration.md:13) has the same conflict, and the row should also classify the remaining policy sentences (the description hint, "Standing guidance...", "the task itself goes in prompt", "To narrow it...") or state that they are protocol.
There was a problem hiding this comment.
Still holds at 6c7a70a9; the schema row is unchanged. docs/design/plugins/Collaboration.md:15 still marks the profile.name and profile.systemPrompt hints Policy, while :45 still says the policy is the guidance in the two descriptions and crates/dim-app-server/src/collaboration.rs:94-101 still has only leader_description and member_description as factory members. The strings remain hardcoded at :3419 and :3423 in agent_definition (:3388), so a candidate that replaces the leader description still carries them, and docs/design/model-prompts.md:168 and :203 cannot be met for those hints. The row also still leaves the profile.description hint, "Standing guidance...", "the task itself goes in prompt" and "To narrow it..." unclassified. Keeping the P2; the fix in the original comment stands. The zh row at docs/zh/design/plugins/Collaboration.md:13 and section 3 at :43 have the same conflict.
There was a problem hiding this comment.
Fixed at 2bbbb18a. The name and systemPrompt hints are gone from the hardcoded schema descriptions (crates/dim-app-server/src/collaboration.rs:3446-3447, :3450-3451) and now sit in LEADER_DESCRIPTION_HEAD (:3384-3386), used only when the factory leader_description is None (:3465-3471); the replacement test (crates/dim-app-server/tests/transport_flow/collaboration.rs:8248-8253) shows a candidate replaces the whole built-in head. The docs schema row is all Protocol (docs/design/plugins/Collaboration.md:15, zh :13) and the description row marks the moved sentences Policy (:16, zh :14); en and zh match. One residual: the new blanket "carries no policy" is overbroad for "Short" (:3440), "in one short line" (:3449) and "omit it on a fresh read" (:3429); filed as an optional P3, not a blocker. Resolved.
| json!({"profile":{"name":"bare","description":""}}), | ||
| ) | ||
| .await; | ||
| assert_ok(&bare); |
There was a problem hiding this comment.
P3, test gap. bare is created and counted but never given a Session, so the two behaviors the new text promises are untested: omitted tools mounts the full set (crates/dim-app-server/src/agents.rs:76 sets SessionConfig.tools = None; crates/dim-agent-capabilities/src/tool_registry.rs:318-343 then declares every host and registered tool), and omitted systemPrompt adds no role prompt (crates/dim-agent-capabilities/src/prompt_sources.rs:147-156).
Failure scenario. Make session_config fall back to the process defaults when profile.tools is None (for example profile.tools.clone().or_else(|| defaults.tools.clone())). A bare Session then declares only [echo, wait, branch], not the full set, while this test still sees assert_ok and a count of 5 and the schema test still passes. The new schema sentence "Omit to give the member the full tool set" would be false with no failing test.
Fix. After assert_ok(&bare), create a Session and assert its model request declares the full set (for example, it includes agent, which the default list does not) and that its system text starts with the guide. A collaboration request with a profile that omits tools would cover the member path as well.
There was a problem hiding this comment.
Still open at 6c7a70a9. bare is created at crates/dim-app-server/tests/transport_flow/agents.rs:657-663 and counted at :675, and no Session is created for it. The new assertion at crates/dim-app-server/tests/transport_flow/collaboration.rs:1996-1998 proves the schema accepts the omission, not the two runtime behaviors (session_config at crates/dim-app-server/src/agents.rs:73-76, session_entry at crates/dim-agent-capabilities/src/prompt_sources.rs:147-152). The failure scenario in the original comment still has no failing test. Keeping the P3.
There was a problem hiding this comment.
Mostly fixed at 2bbbb18a. The new test creates a Session for bare and asserts the declared set is larger than the default mount list and contains it, and that the system starts with the guide (crates/dim-app-server/tests/transport_flow/agents.rs:664-678). Mutations: a session_config tools fallback fails at :670 with ["branch", "echo", "wait"]; a role prompt added in session_config fails at :634. declared.len() > tools.len() holds in this fixture, where the full set is larger than the three-tool default list. One residual: the PromptSources session_entry path (crates/dim-agent-capabilities/src/prompt_sources.rs:543-547, used by session.agent.update at crates/dim-app-server/src/agents/configuration.rs:301) is not exercised; a mutation there passes the new test. Residual P3 optional.
| pub struct AgentProfile { | ||
| pub name: String, | ||
| pub description: String, | ||
| #[serde(default)] |
There was a problem hiding this comment.
P3, optional. The final head dropped the comment that stated this field's contract. AgentProfile is the public producer type for agent.create, stored agents.profile records and collaboration/request, and #[serde(default)] plus a plain String do not say that omission is accepted or that empty means no dim/session prompt (crates/dim-agent-capabilities/src/prompt_sources.rs:147-156). A reader must now find the design page to learn it.
Fix. Restore a one-line ///: role instructions delivered as the Sessions' dim/session prompt; empty, the default, delivers none.
There was a problem hiding this comment.
Not restored at 6c7a70a9: crates/dim-agent-types/src/profile.rs:17-18 adds #[serde(default)] and no doc, while tools at :19-20 keeps its own. One correction: origin/main never had this doc either; it was present in this PR's earlier revision (5a2d71f) and the rewrite dropped it, so the final diff adds the attribute without the contract rather than removing an existing comment. Still optional: one line stating that omission means no dim/session prompt. Non-blocking.
There was a problem hiding this comment.
Remains at 2bbbb18a: crates/dim-agent-types/src/profile.rs:17-18 still adds #[serde(default)] without a doc, while tools at :19-22 keeps its own. The new commit does not touch it. Optional.
- A leader's message is framed "your team leader, sent you this message"; only a request keeps "assigned you this work". - A message defaults to steer; append stays available. - The request bullet says it starts a member from an Agent and gives it a task, and that a running task is replaced by cancel and request again. - The message bullets state how each mode reaches an idle receiver, and that a message starts no task and returns no result.
zerob13
left a comment
There was a problem hiding this comment.
Reviewed 7451429b65f3610d7118190335519e0ceebef092. The optional systemPrompt still preserves existing empty behavior. The two earlier conditions remain, and there is one new compatibility regression:
- Preserve behavior for omitted message mode. The new default makes the same
agent.messagecall wake an idle recipient and start a model turn rather than wait for the recipient's next turn. Verify that omitting mode keeps append behavior for existing callers, while explicit steer still wakes an idle recipient, or obtain a separate compatibility decision for changing the default. Default · Existing contract - Resolve the temporary-member tool default. Isolated first-request checks confirm omission exposes the full declarations and an explicit empty list does not. Keep explicit tool choice or obtain agreement on the wider default; inherited Permission and Approval remain independent. Earlier criteria
- Keep new model guidance factual or replaceable and evaluated. Replacing the leader description still leaves the hard-coded naming and role-prompt advice in the schema; the shipped comparison is still absent. Schema and factory selection
Focused local tests confirmed the message and tool behaviors. Exact hosted CI passed and is separate from these acceptance conditions.
zerob13
left a comment
There was a problem hiding this comment.
Reviewed 6c7a70a9b284586607a40595f323603aa6524974. The previous conditions still apply: preserve omitted-message append semantics, make the wider temporary-member tool default an explicit decision, and keep any new policy factual or replaceable and evaluated. Optional systemPrompt still meets its criterion. Previous review
New protocol mismatch: scope the automatic last reply to an open delegation. The member description now says the leader automatically receives the last reply when the member stops. A standalone steer can wake a member after its assignment has settled; the existing flow verifies that this turn delivers no automatic report. A member following the new description can therefore leave the leader without its answer. Verify the member's tool description distinguishes automatic result delivery for an open request from a standalone turn. Description · Standalone steer flow
Exact-pair CI passed, including the existing standalone steer behavior.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope. This PR makes profile.tools and profile.systemPrompt optional in the leader's agent schema, describes the profile fields and prompt, adds #[serde(default)] to AgentProfile.system_prompt, makes an omitted message mode default to steer, separates a leader's request relation from its message relation, and at this head also tells members that their last reply is the result. I reviewed the full origin/main...head diff at 6c7a70a9 and the three earlier threads.
Blocking (P2), schema hints, unchanged. docs/design/plugins/Collaboration.md:15 still marks profile.name's "A person's name that fits the user's language and region works well." and profile.systemPrompt's "use it only when the role truly needs that" as Policy, while :45 still says the policy is the guidance in the two descriptions, and crates/dim-app-server/src/collaboration.rs:94-101 still has only leader_description and member_description as factory members. Both hints are hardcoded in agent_definition (:3388, strings at :3419 and :3423), so an assembly that replaces leader_description still carries them: docs/design/model-prompts.md:168 and :203 cannot be met for a candidate change to either hint. The row also still leaves the profile.description hint, "Standing guidance...", "the task itself goes in prompt" and "To narrow it..." unclassified. The fix in thread 4703986260 stands. The zh page has the same conflict at docs/zh/design/plugins/Collaboration.md:13 and :43.
Blocking (P2), false member sentence, new at this head. MEMBER_DESCRIPTION now ends "When you stop, your last reply is the result the leader receives; do not send it as a message." (crates/dim-app-server/src/collaboration.rs:3385-3386). It is unconditional, and docs/design/plugins/Collaboration.md:16 and docs/zh/design/plugins/Collaboration.md:14 classify it Protocol. It is false for a message-initiated turn.
Failure scenario. A leader sends a message with the new default steer to an idle member that has no open request. The member runs a turn, follows "do not send it as a message", stops, and no collaboration/result is written. The leader never receives the reply, and the member believes it was delivered. This is now the default path for a message to an idle member.
Evidence. The message branch writes an input and returns with no Request record (crates/dim-app-server/src/collaboration.rs:2087-2110); only a request inserts one (:2272-2291). write_delivered schedules settle only for an Op whose request is true (:2399-2420), and settle appends collaboration/result (:2488-2499); the reload writer is request-only too (:4197). The flow test at crates/dim-app-server/tests/transport_flow/collaboration.rs:3614 sends a later steer to an idle member, shows a real turn (:3774-3807) and leaves the result count at one, the earlier cancelled result (:3808-3828). The leader's own text says "A message starts no task and returns no result" (:3365-3366). A request always has a Request and a settle, so the sentence is true there; it is false only for a message turn. The new inline at :3385 gives the fix: qualify the sentence to a task, for example "When you finish a task, your last reply is the result the leader receives; do not send it as a message.", and update the two docs rows.
P3, test gap, unchanged. The bare profile is created and counted only (thread 4703986267). The new assertion at crates/dim-app-server/tests/transport_flow/collaboration.rs:1996-1998 proves the schema accepts the omission, not the two runtime behaviors. A session_config fallback that reuses defaults.tools when profile.tools is None, or a session_entry that always adds a role prompt, still has no failing test. crates/dim-app-server/src/agents.rs:73-76 and crates/dim-agent-capabilities/src/prompt_sources.rs:147-152 remain unpinned for this profile.
P3, test gap, unchanged. The relation mapping at crates/dim-app-server/src/collaboration.rs:2702-2709 is not asserted. agent_message (crates/dim-app-server/tests/transport_flow/collaboration.rs:7973-7981) strips everything before ":\n", so sent["mode"] at :1798 and the explicit steer at :1874-1881 see only the mode and content. Restoring the old match self.role makes a leader's message read "your team leader, assigned you this work" again, and the whole suite still passes. docs/design/plugins/Collaboration.md:19 marks the three relation sentences Protocol. See the new inline at :1798.
P3, optional type doc, unchanged. crates/dim-agent-types/src/profile.rs:17-18 adds #[serde(default)] without a doc, while tools at :19-20 keeps its own. See thread 4703986270.
Verified at 6c7a70a.
- Omitted message mode reaches
InputMode::Steer:CollaborationMessageMode's default isSteer(crates/dim-agent-types/src/events.rs:1182-1186), the action field uses#[serde(default)](crates/dim-app-server/src/collaboration.rs:3330-3331), and delivery maps it at:2093-2096. The schema leavesmodeoptional (:3398,:3477) and the bullet at:3363-3367states the default. - Steer wakes an idle branch and append does not:
docs/design/contracts/session-access.md:148,crates/dim-agent-capabilities/src/input_queue.rs:191andcrates/dim-agent-capabilities/src/agent_loop.rs:178,:1373-1377. The flow atcrates/dim-app-server/tests/transport_flow/collaboration.rs:3614(steer at:3774-3780) starts real member work and writes no result for it. - The only
message_inputcallers arecrates/dim-app-server/src/collaboration.rs:2104(message, append or steer) and:2296(request, alwaysQueue).requestis leader-only (:1093-1102), so a leader's request cannot take the message branch. The result and final-answer path usesdim-agent-report(:2640-2684), not the message marker. The relation strings in the docs match the code verbatim. - A delivered request always has a result: the request record (
:2272-2291), the settle scheduled after the member goes idle (:2399-2420), thecollaboration/resultappend (:2488-2499), and the reload settlement (:4197). This is why the member sentence is true for a task and false for a message. - Omitted
systemPromptadds nodim/sessionentry (crates/dim-agent-capabilities/src/prompt_sources.rs:147-152); omittedtoolsleavesSessionConfig.tools = None(crates/dim-app-server/src/agents.rs:73-76) andToolRegistrydeclares the full set (crates/dim-agent-capabilities/src/tool_registry.rs:314-343). Records still serialize the field. Unresolved mount-list names are still dropped attool_registry.rs:438-444. The member inherits the leader's Permission and Approval, so I found no authorization escalation. - The docs' quoted sentences all exist in the code; the two new relation strings and the mode default match. The new member sentence matches too, but its truth is the P2 above.
On the other reviews. I agree with zerob13 on 3, which is the schema P2 above; on 1, stored collaboration/message events always carry mode and the only producer is the agent tool's argument parser (crates/dim-app-server/src/collaboration.rs:1076, field at :3330-3331), so I do not treat the omitted-mode change as a persisted-contract break; on 2, the text is accurate and capping the member's mount list is listed as out of scope.
Cross-PR. git merge-tree is clean against origin/main c68dad5 and the current heads of #2197 8701164, #2206 496d4d2, #2210 69a43e8, #2174 1ed1352, #2212 cdba6df and #2211 ae694e9. Once #2197 lands, "the full tool set" should be read as the mode's callable set.
Verification. cargo test --locked -p dim-app-server --test transport_flow -- agents:: collaboration::: 74 passed, 0 failed, 1 ignored. cargo test --locked -p dim-agent-types: 10 lib tests and 48 contract tests passed, 0 failed. CI at 6c7a70a9: ci-ok, changes, macos-native, windows-cli and verify (linux) succeeded; static-checks, scripts, web, acp-registry and dependencies were skipped. No residual test processes; the worktree is clean at 6c7a70a9.
Verdict. REQUEST_CHANGES: the schema-hint P2 and the new member-sentence P2 are open.
| together with the branchId the page reported. list: show your team. | ||
| Your final answer to the task is returned to the leader automatically; do not send it | ||
| as a message."; | ||
| When you stop, your last reply is the result the leader receives; do not send it as a |
There was a problem hiding this comment.
P2, contract. This sentence is unconditional: "When you stop, your last reply is the result the leader receives." docs/design/plugins/Collaboration.md:16 and docs/zh/design/plugins/Collaboration.md:14 classify it Protocol. It is false for a message-initiated turn.
Failure scenario. A leader sends a message with the new default steer to an idle member that has no open request. The member runs a turn, follows "do not send it as a message", stops, and no collaboration/result is written. The leader never receives the reply, and the member believes it was delivered. This is now the default path for a message to an idle member.
Evidence. The message branch writes an input and returns with no Request record (crates/dim-app-server/src/collaboration.rs:2087-2110); only a request inserts one (:2272-2291). write_delivered schedules settle only for an Op whose request is true (:2399-2420), and settle appends collaboration/result (:2488-2499); the reload writer is request-only too (:4197). The flow at crates/dim-app-server/tests/transport_flow/collaboration.rs:3614 sends a later steer to an idle member, shows a real turn (:3774-3807) and leaves the result count at one (:3808-3828). The leader's own text says "A message starts no task and returns no result" (:3365-3366). A request always has a Request and a settle, so the sentence is true there; it is false only for the message turn.
Fix. Qualify it to a task: "When you finish a task, your last reply is the result the leader receives; do not send it as a message." Update the two docs rows to the new sentence. Or state in the member text that a message starts no task and returns no result.
There was a problem hiding this comment.
Fixed at 2bbbb18a. MEMBER_DESCRIPTION now reads "When you finish a task, your last reply is the result the leader receives; do not send it as a message." (crates/dim-app-server/src/collaboration.rs:3413-3414), quoted as Protocol at docs/design/plugins/Collaboration.md:16 and docs/zh/design/plugins/Collaboration.md:14; the old text is gone. A request always has a Request and a settle (:2277-2296, :2392-2430, :2496-2507), and a message-initiated turn has no task, so the sentence no longer claims a result for it; the flow at crates/dim-app-server/tests/transport_flow/collaboration.rs:3808-3864 still shows a message turn with no result. Resolved.
| let sent = last_ok(&member_timeline); | ||
| assert_eq!(sent["status"], "delivered"); | ||
| assert_eq!(sent["mode"], "append"); | ||
| assert_eq!(sent["mode"], "steer"); |
There was a problem hiding this comment.
P3, test gap. The relation mapping at crates/dim-app-server/src/collaboration.rs:2702-2709 is not asserted. agent_message (crates/dim-app-server/tests/transport_flow/collaboration.rs:7973-7981) strips everything before ":\n", so this assertion and the explicit steer at :1874-1881 see only the mode and content. docs/design/plugins/Collaboration.md:19 marks the three relation sentences Protocol.
Failure scenario. Restore the old match self.role so a leader's message again reads "your team leader, assigned you this work": every transport_flow test still passes and the defect this PR exists to fix returns.
Fix. Assert the marker prefix: a leader's message Agent <id>, your team leader, sent you this message:, a request ..., your team leader, assigned you this work:, and a member's message ..., your teammate, sent you this message:. docs/design/model-prompts.md:66 requires the protocol sentence to land with the flow test that asserts it.
There was a problem hiding this comment.
Narrowed at 2bbbb18a. The new frames at crates/dim-app-server/tests/transport_flow/collaboration.rs:1892-1915 pin the leader request ("assigned you this work") and the leader message ("sent you this message") with the leader session attribute; :1809-1817 pins the member-to-leader relation. I verified sensitivity: changing the Leader arm back to "assigned you this work" fails the second frame, and changing the request relation to "sent you this message" fails the first. Still unasserted: a member-to-teammate message (your teammate, crates/dim-app-server/src/collaboration.rs:2722) and the approvals denial path (crates/dim-app-server/src/collaboration/approvals.rs:251; the relation string is covered through the leader arm, the path is not). Remaining P3 optional.
- dim-agent-message carries the sender's session beside its agent, so a receiver can reply to or read the exact member even when several members share one Agent. - The relation sentence names the sender's Agent and is written from the receiver's side: a member's message to its leader is "a member of your team", not "your teammate". - The guide entry says the attributes address a reply.
…mber result - The naming and systemPrompt hints move from the profile property descriptions into the leader description, which the factory can replace; the property descriptions state only facts. - The member text says the last reply is the result when it finishes a task, since a message-started turn returns no result. - The flow tests pin that a profile without tools declares the full set rather than the default mount list, that one without systemPrompt adds no role prompt, and the leader's request and message relation sentences.
zerob13
left a comment
There was a problem hiding this comment.
Reviewed 2bbbb18a5566710976f63087a2a91dc671ee09b6. The standalone result description is now scoped to finishing a task, and the leader's role/naming guidance is now factory-replaceable. Remaining acceptance criteria:
- Without an accepted contract change, an
agent.messagecall with no mode appends without waking an idle recipient; explicitsteercan still wake it. Likewise, the default temporary member tool declarations must not broaden merely by omittingtoolswithout an explicit product decision. See the prior review. - For the shipped role/naming advice, show the comparative behavioral evidence required by the prompt design contract, or keep the default factual. Replaceability no longer blocks.
- New history compatibility regression from the reply guide. A resumed message can still have only the legacy
agentattribute. The guide instructs the model to copy asessionthat is absent, and the tool expects it. Keep direct reply for messages with both IDs; for legacy messages, verify the sender can be resolved when unique and that an ambiguous ID is not used to guess the recipient's Session. Reply guide · Participant lookup
The history finding is static; the amended flow tests are in current CI.
|
@zerob13 @yyhhyyyyyy thanks for the reviews. The fixes are in Schema hints (P2). The property descriptions now state only facts. The naming hint and the systemPrompt hint moved into the leader description, which the factory can replace: Member result sentence (P2). It is now scoped to a task: Temporary-member tool default. This is an intended product decision. An omitted Omitted message mode. Defaulting to Test gaps (P3).
Local: |
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope. This PR clarifies the leader's agent declaration and the request/message semantics: optional profile.tools and profile.systemPrompt with factual descriptions, AgentProfile.system_prompt with #[serde(default)], an omitted message mode defaulting to steer, the request relation separated from the message relation, the sender's name and session in the marker, and a guide reply instruction. At 2bbbb18a it also moves the two profile hints into the leader description, scopes the member result sentence to a task, and adds flow tests for the bare profile and the leader relations. I reviewed the full origin/main...2bbbb18a diff, the five threads and the other reviews, ran the two target tests, and ran five mutations. Both P2s are fixed; the remaining items are P3 optional.
Fixed (P2), schema hints. The name and systemPrompt hints are gone from the hardcoded schema descriptions (crates/dim-app-server/src/collaboration.rs:3446-3447, :3450-3451) and now sit in LEADER_DESCRIPTION_HEAD (:3384-3386), which is used only when the factory's leader_description is None (:3465-3471). The factory replacement test (crates/dim-app-server/tests/transport_flow/collaboration.rs:8248-8253) shows a candidate replaces the whole built-in head, so the moved sentences disappear. The docs schema row is all Protocol (docs/design/plugins/Collaboration.md:15, docs/zh/design/plugins/Collaboration.md:13), the description row marks the moved sentences Policy (:16 and :14), and the two languages match. One residual, P3 optional below: the new blanket "Every property description states a fact and carries no policy" is overbroad for three advisory phrases.
Fixed (P2), member sentence. MEMBER_DESCRIPTION now ends "When you finish a task, your last reply is the result the leader receives; do not send it as a message." (crates/dim-app-server/src/collaboration.rs:3413-3414), quoted as Protocol at docs/design/plugins/Collaboration.md:16 and docs/zh/design/plugins/Collaboration.md:14; the old "When you stop" text is gone. The sentence is true for a request, which always has a Request and a settle (:2277-2296, :2392-2430, :2496-2507), and a message-initiated turn has no task, so it no longer claims a result for it. The flow at crates/dim-app-server/tests/transport_flow/collaboration.rs:3808-3864 still shows a message turn that writes no result.
P3, relation coverage, narrowed. The new frames at crates/dim-app-server/tests/transport_flow/collaboration.rs:1892-1915 pin the leader request ("assigned you this work") and the leader message ("sent you this message") with the leader session attribute; :1809-1817 pins the member-to-leader relation. Still unasserted: a member-to-teammate message (your teammate, crates/dim-app-server/src/collaboration.rs:2722) and the approvals denial path (crates/dim-app-server/src/collaboration/approvals.rs:251; its relation string is covered through the leader arm, the path is not). Optional; see the reply on 4704267455.
P3, bare profile, mostly fixed. The new test creates a Session for bare and asserts the declared set is larger than the default mount list and contains it, and that the system starts with the guide (crates/dim-app-server/tests/transport_flow/agents.rs:664-678). The strict declared.len() > tools.len() holds in this fixture: the full set is larger than the three-tool default mount list, and the > is what makes the fallback mutation fail. One residual: the PromptSources session_entry path (crates/dim-agent-capabilities/src/prompt_sources.rs:543-547, used by session.agent.update at crates/dim-app-server/src/agents/configuration.rs:301) is not exercised. Optional; see the reply on 4704268652.
P3, type doc, remains. crates/dim-agent-types/src/profile.rs:17-18 still adds #[serde(default)] without a doc, while tools at :19-22 keeps its own. See the reply on 4704268937.
P3, sender name, remains. The sentence still renders profile.name (crates/dim-app-server/src/collaboration.rs:2741), but neither the collaboration schema (:3446-3447) nor agent.create (crates/dim-app-server/src/agents.rs:2063-2072, no name check at :2077-2085) rejects an empty name or a line break, and crates/dim-agent-capabilities/src/context_block.rs:35-41 escapes only &, <, >. An Agent named "" yields Agent , a member of your team, sent you this message:, against the Protocol claim at docs/design/plugins/Collaboration.md:19 and the guide entry at :3548 that the sentence names the sender. See the inline at :2741.
P3, older stored markers, remains. A history stored by origin/main has <dim-agent-message agent="..."> without session, and a leader's old message says "assigned you this work" (at c68dad5a, crates/dim-app-server/src/collaboration.rs:2703-2705). Under the new rows such a marker has no session for the reply, and a leader's old message reads as a request. The page does not state the compatibility it keeps, which docs/design/model-prompts.md:66 asks an owner to state for a protocol change. Non-blocking; the old form is still readable as a message.
P3, new: the schema claim is overbroad. docs/design/plugins/Collaboration.md:15 and the zh row :13 say every property description states a fact and carries no policy. Under the model-prompts section 4 test, three clauses are advisory, not factual: "Short" (crates/dim-app-server/src/collaboration.rs:3440), "in one short line" (:3449) and "omit it on a fresh read" (:3429). Editing them changes only the model's choice, not the runtime, and none is factory-configured. Fix: delete those three phrases or narrow the claim to the descriptions that state schema facts and accepted values. See the inline at docs/design/plugins/Collaboration.md:15. The PR body's "Property descriptions state only facts." has the same overbreadth.
Tests and mutations at 2bbbb18. collaboration::leader_delegates_and_team_members_communicate and agents::agent_profile_supplies_session_defaults pass. Mutations, each applied temporarily and reverted:
session_configtools fall back to the default mount list: the bare assertion fails atcrates/dim-app-server/tests/transport_flow/agents.rs:670with["branch", "echo", "wait"].- A role prompt added in
session_config: the system assertion fails at:634(and would fail the bare check). prompt_sources::session_entryalways adds a role prompt: the test still passes; this is the residual above.- The Leader message relation changed to "assigned you this work": the second new frame fails at
crates/dim-app-server/tests/transport_flow/collaboration.rs:1911. - The request relation changed to "sent you this message": the first new frame fails at
:1911.
PR body. It is not stale: it quotes the new factual profile descriptions, places the two hints in the leader description, and quotes "When you finish a task...". Its "Property descriptions state only facts." shares the P3 overbreadth above.
CI and merge-tree. CI at 2bbbb18a: changes, macos-native, windows-cli, verify (linux) and ci-ok succeeded; the rest were skipped by path filters. git merge-tree is clean against the latest remote main 626f280 and the current heads of #2197 49c14ad, #2206 f125d5f, #2174 3914eaa, #2212 cfb6c05, #2211 57f9390 and #2223 4ce2dd7; #2210 was merged at 626f280. No residual processes; the worktree is clean at 2bbbb18a.
Verdict. APPROVE. The schema-hint P2 and the member-sentence P2 are fixed; the remaining P3s are optional.
| &format!( | ||
| "Agent {}, {relation}:\n{}", | ||
| context_block::text(agent_id), | ||
| context_block::text(&sender.profile.name), |
There was a problem hiding this comment.
P3, optional. The sentence renders sender.profile.name here, but the name is unconstrained: the collaboration schema (crates/dim-app-server/src/collaboration.rs:3446-3447) and agent.create (crates/dim-app-server/src/agents.rs:2063-2072, with no name check at :2077-2085) accept an empty string or a line break, and crates/dim-agent-capabilities/src/context_block.rs:35-41 escapes only &, < and >.
Failure scenario. A client creates an Agent with profile {"name":"","description":""} and the leader requests it. The member's message to the leader reads Agent , a member of your team, sent you this message:, while docs/design/plugins/Collaboration.md:19 and the guide entry (crates/dim-app-server/src/collaboration.rs:3548) say the sentence names the sender. A name containing :\n also breaks the first-sentence claim and the :\n split in crates/dim-agent-capabilities/src/adapters.rs:99.
Fix. Require a nonblank single-line name where the profile enters (the title check at crates/dim-app-server/src/collaboration.rs:1159-1165 is the pattern), or fall back to sender.agent_id when the name is blank and flatten line breaks before formatting. Non-blocking.
| | --- | --- | | ||
| | `agent` declaration, schema | Protocol: the actions each role may call, `agentId`, `sessionId`, `content`, `mode`, `after`, `branchId`, `limit`, `resultId`, `prompt`, `title` and the `profile` object. A leader gets `models` only where the deployment provides Provider's selectable-model read (§7) | | ||
| | `agent` declaration, description | Protocol: every sentence that states what an action does or what the runtime guarantees — the request/cancel/close/message/read/list/inspect/models/result bullets, "Returns immediately; the member's final result arrives later as an input.", "One task per member at a time.", "The user's subagent model policy may override the model a new member's profile requests.", and the `append` mode's "adds context the receiver sees in its next step without interrupting it". Policy: "Use mode \"steer\" only when the receiver must change course now.", "Address members with agentId + sessionId from earlier results.", and the member text's "do not send it as a message" | | ||
| | `agent` declaration, schema | Protocol: the actions each role may call, `agentId`, `sessionId`, `content`, `mode`, `after`, `branchId`, `limit`, `resultId`, `prompt`, `title` and the `profile` object, whose `systemPrompt` is optional and, omitted, adds no role instructions, and whose `tools` is optional and, omitted, mounts the full tool set. Every property description states a fact and carries no policy: `prompt`'s, `title`'s, and `profile`'s `name`, `description`, `systemPrompt` and `tools` descriptions, including "To narrow it, use tool names exactly as they are declared to you." and "the task itself goes in prompt". A leader gets `models` only where the deployment provides Provider's selectable-model read (§7) | |
There was a problem hiding this comment.
P3, optional. The row says every property description states a fact and carries no policy, but under the test at docs/design/model-prompts.md:54-55 three clauses are advisory: "Short" in the title description (crates/dim-app-server/src/collaboration.rs:3440), "in one short line" in profile.description (:3449), and "omit it on a fresh read" in branchId (:3429). Editing them changes only the model's choice, not the runtime, and none is factory-configured.
Fix. Delete the three phrases or narrow the claim to the descriptions that state schema facts and accepted values. The zh row at docs/zh/design/plugins/Collaboration.md:13 has the same. Non-blocking.
There was a problem hiding this comment.
Remains at 62d5ecc, still optional. The three advisory clauses are unchanged, and the schema row now also quotes the advisory "To narrow it, use tool names exactly as they are declared to you." inside the same blanket claim. The fix is the same: delete those phrases or narrow the claim to the descriptions that state schema facts and accepted values. See the review body.
…ions The Collaboration design now states, as accepted contract, that an omitted profile.tools declares the member's full set and that an omitted message mode is steer, with the reasons and compatibility, and where the leader's naming and systemPrompt hints come from.
|
@zerob13 thanks. Here is each of the three points at 1. Omitted mode and the tool default. I turned both into contract changes in the design rather than leaving them as PR notes. Collaboration §1, "Defaults of a request and a message" (en and zh) now records:
The mount contract in session-access already says a profile without 2. Naming and systemPrompt hints. These are not new guesses. They carry over the previous TypeScript product's behavior: person names for members were well received by users, and the role prompt was not required because models often write one that does not help. The same section records this provenance. The hints sit in the replaceable leader description, so any later candidate change to them is judged by model-prompts §8. 3. Legacy messages without |
zerob13
left a comment
There was a problem hiding this comment.
This delta only adds the "Defaults of a request and a message" section to the English and Chinese Collaboration design docs. No code changed in this commit.
Condition 1 is closed: the docs now record the two defaults as a decision, and the text matches the code. CollaborationMessageMode defaults to Steer (crates/dim-agent-types/src/events.rs:1182-1186), the Message action defaults its mode (crates/dim-app-server/src/collaboration.rs:3353-3358), and an omitted mount list declares the full tool set while [] declares none (docs/design/contracts/session-access.md:337).
Two items still block merge.
- The two shipped policy sentences still lack the evaluation the prompt contract requires.
docs/design/model-prompts.md:145asks for a same-cases, same-model, same-budget comparison with one fixed judge;:153requires at least 20 judged runs per arm;:177requires the scenario set to run locally and be reported in the PR. The new paragraph only asserts what the previous TypeScript product did. Either run that comparison or remove the sentences (crates/dim-app-server/src/collaboration.rs:3384-3386). - Legacy
agent-only messages still have no reply path. The guide tells the model to copy both ids (crates/dim-app-server/src/collaboration.rs:3548), butresolverequires asession_id(:586-595). A resumed message that only hasagentcannot reply without guessing the Session.
Two small fixes in the new text:
docs/design/plugins/Collaboration.md:34says Permission and Approval are inherited. Only Permission is.docs/design/subagent-tool-approval.md:22-23says a member's own Approval admits its tools and there is no inherited per-call approval.docs/zh/design/plugins/Collaboration.md:36links#8-judging-a-change, which is the English heading. The Chinese anchor is#8-一次改动怎样判定.
Verdict: REQUEST_CHANGES
- model-prompts section 8 accepts a logically sound design rationale in the owner's design in place of the comparison, until one is run. - Collaboration records that the naming and systemPrompt hints ship on that rationale, corrects that only Permission is inherited, and fixes the zh anchor. - The message guide entry tells the model how to find the sender of a message without a session attribute, and not to guess when several members share its agentId.
|
@zerob13 I'm answering as maintainer. Each point below refers to 1. Policy sentences without an evaluation. This is a maintainer decision, and I've made it part of the rule rather than an exception for this PR. model-prompts §8 (en and zh) now lets a policy text ship without the comparison when its owner records a logically sound design rationale in the owner's design: what the text asks, why it should help, and where that expectation comes from. That rationale stands in for the evaluation until one is run, and any later candidate change is still judged by §8.1. The Collaboration "Defaults of a request and a message" section is that rationale for the naming and systemPrompt hints. It cites the previous TypeScript product, where person names for members were well received and an optional role prompt avoided low-quality ones. 2. Messages with only Small fixes.
Local: |
zerob13
left a comment
There was a problem hiding this comment.
Reviewed 6d0465da60b81029e868205f64ed5c9d9549a717. The defaults remain accepted as recorded in the previous review. The legacy reply guide now provides a lookup for messages without a Session ID and says not to guess when the sender is ambiguous; that item is closed.
Remaining decision: changing the repository-wide acceptance bar for shipped model policy. The proposed §8 change allows written rationale to replace the base branch's comparative evaluation for policy text. This is wider than changing Collaboration prompts. Keep the current requirement for this PR (compare behavior or ship factual guidance), or obtain an explicit decision on the general exception before relying on it. The TypeScript precedent is useful rationale but does not by itself establish the new Rust behavior. Current CI.
Dismissed by maintainer decision: the remaining points (policy hints, legacy messages) are settled in model-prompts §8 and Collaboration §1 at 6d0465d; see the maintainer reply on this PR.
…uide The longer clause pushed the guide past the compaction flow's fixed budget; the short form keeps the same instruction.
zerob13
left a comment
There was a problem hiding this comment.
Reviewed 3e0682bd (delta 6d0465da..3e0682bd; copy only, 4 files +4/−4).
The production guide constant, the flow-test constant, and both language docs rows match byte for byte; no stale copy of the old wording remains. The shorter clause keeps the behavior the guide needs: message still requires agentId + sessionId (crates/dim-app-server/src/collaboration.rs:3492), and list returns both for a sender found in the participant list. The maintainer decision recorded at 07:14 and the model-prompts §8 change resolve the prior policy question. No blocking issue.
Non-blocking doc nits:
- "find the sender in list" is behavior guidance; consider moving it to the policy column and leaving only the fact "Without a session attribute" in protocol.
- "the rest of that sentence" no longer points at any remaining text after the rewrite.
- The old text explicitly said the
agentattribute names only the Agent; the new text drops that bridge.liststill makes the mapping work, but restoring the fact would make legacy-message handling more deterministic.
CI: verify (linux) was still running at review time; the other jobs passed.
Verdict: APPROVE.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope. This PR clarifies the leader's agent declaration and request/message semantics: optional profile.tools and profile.systemPrompt with factual descriptions, AgentProfile.system_prompt with #[serde(default)], an omitted message mode defaulting to steer, the request relation separated from the message relation, the sender's name and session in the marker, and a guide reply clause for messages without a session attribute. I reviewed the full origin/main...3e0682bd diff, every thread, both languages, and the sections the new text cites, and ran the two target flows plus two mutations.
P2, contract contradiction. docs/design/model-prompts.md:143 lets a policy text ship without the comparison when its owner records a rationale, and says the rationale "stands in for the evaluation until one is run". The same page still says the opposite in seven places: :9 and :68 ("every change to it is evaluated"), :15 and :126 ("Each policy text carries one evaluation"), :17 and :179 (a change to a text with no harness must bring its own scenario set, run locally and reported in the pull request), and :27 ("Policy changes on evidence"). The zh page repeats all seven at docs/zh/design/model-prompts.md:9, 15, 17, 27, 68, 126, 179. No section names who runs the promised evaluation or when.
Failure scenario. A contributor adds a policy sentence with a rationale and cites :143. One reviewer applies :68 and :179 and blocks for lack of an evaluation or a scenario set; another applies :143 and approves. Both read the same requirements page, and the change has two verdicts. Or the sentence ships and no evaluation is ever run, while :126 still claims one exists. This PR already relies on the exception for the two hints at docs/design/plugins/Collaboration.md:38, and it reports no evaluation.
Fix. If the exception stays, restate the rule once: update :9, :15, :17, :27, :68, :126, :179 and the zh counterparts to refer to the exception, and state the trigger, owner and tracking issue for the deferred evaluation. If it does not stay, revert :143 and judge the two hints under §8.1 or ship factual guidance. This is a consistency fix; it does not ask to revisit the decision itself.
Verified, no finding.
- An omitted
profile.toolsbecomesSessionConfig.tools = None(crates/dim-app-server/src/agents.rs:73-76), and the mount contract then declares every host and registered tool (docs/design/contracts/session-access.md:337). Permission is sampled from the requesting branch, and the member's own Approval routes its asks onward (docs/design/subagent-tool-approval.md:22-24,crates/dim-app-server/src/collaboration/approvals.rs:251). The corrected sentence atdocs/design/plugins/Collaboration.md:34is accurate; only Permission is inherited. - The message mode text matches the runtime.
Steeris consumed at the next boundary and starts an idle turn, whileAppendwaits (docs/design/contracts/session-access.md:148). The message branch writes noRequest, andsettleis request-only (crates/dim-app-server/src/collaboration.rs:2087-2112,:2393-2429,:2434,:2498), so a message-started turn writes nocollaboration/result.CollaborationMessageData.modeis a required field (crates/dim-agent-types/src/events.rs:1196), so stored facts carry it and the default change affects only new calls that omit it. - The shortened legacy clause is accurate.
crates/dim-app-server/src/collaboration.rs:3548contains the exact sentence quoted atdocs/design/plugins/Collaboration.md:20and zh:18.listreturns each participant'sagentIdandsessionIdfor a leader and for a member (crates/dim-app-server/src/collaboration.rs:634,:1397-1429). The clause gives a lookup and forbids guessing, so it does not weaken the reply contract. - The one test line is justified. The code constant and
crates/dim-app-server/tests/transport_flow/collaboration.rs:21must stay byte for byte; replacing the code constant with the old text fails the entry assertion at:1580-1583. - EN and ZH defaults sections agree. The zh links resolve to
docs/zh/design/contracts/session-access.mdanddocs/zh/design/model-prompts.md#8-一次改动怎样判定. - At 3e0682b,
collaboration::leader_delegates_and_team_members_communicateandagents::agent_profile_supplies_session_defaultspass. Mutations: restoring#[default] Appendfails the mode assertion atcrates/dim-app-server/tests/transport_flow/collaboration.rs:1798; removing the new clause from the code constant fails the entry assertion.
P3, optional.
- The blanket claim at
docs/design/plugins/Collaboration.md:15and zh:13still covers three advisory phrases: "Short" (crates/dim-app-server/src/collaboration.rs:3440), "in one short line" (:3449) and "omit it on a fresh read" (:3429). crates/dim-agent-types/src/profile.rs:17-18still adds#[serde(default)]without a doc for the omission contract.- The sender's
profile.nameis still unconstrained (crates/dim-app-server/src/collaboration.rs:3446-3447; no name check atcrates/dim-app-server/src/agents.rs:2077-2085), so an empty name yieldsAgent , a member of your team, .... - The member-to-teammate relation and the approval-denial path remain unasserted (
crates/dim-app-server/src/collaboration.rs:2722,crates/dim-app-server/src/collaboration/approvals.rs:251). - The bare profile still does not exercise the PromptSources
session_entrypath (crates/dim-agent-capabilities/src/prompt_sources.rs:543-547). - The marker row at
docs/design/plugins/Collaboration.md:19listsagentandsessionas the sender's attributes but does not say a stored message from before this change has onlyagent. The new guide clause now handles that reply path, so this is a wording gap, not a missing behavior. - The EN guide row's "the rest of that sentence" now follows "never guess its session", so it can read as the legacy sentence; the zh row ties it to the report sentence. Name the sentence or move the phrase.
- The PR body is stale on two points. It says "Permission and Approval are inherited as before", while the design now says only Permission is inherited (
docs/design/plugins/Collaboration.md:34), and it quotes "The agent and session attributes address a reply.", which is not the shipped text atcrates/dim-app-server/src/collaboration.rs:3548.
CI and merge. At 3e0682b the PR is open, not draft, MERGEABLE and UNSTABLE: changes, macos-native and windows-cli pass, verify (linux) is pending in run 45777071672, and the other checks skip on path filters. Main moved from 35c99ab to 30421b4 (the #2223 merge) during this review; 35c99ab was green, and 30421b4's checks are still running. git merge-tree origin/main 3e0682bd is clean, and auto-base merge-trees are clean with the current heads of #2206 8041156, #2197 12a70b7, #2174 2365568, #2220 c70fc90, #2225 a9116c4 and #2202 08b73bf. #2223 is merged, and #2202 is CLEAN. No conflicts. I did not wait for CI.
Unverified. The claim that the previous TypeScript product's users received person names well and did not need a role prompt cannot be checked from this repository; it is the rationale, not measured evidence. The deferred evaluation in §8 does not exist. I ran only the two target flows and the two mutations; I did not run the full suite.
Old comments. None should be withdrawn. The two round-2 P2 threads are already resolved at 2bbbb18. The P3 threads remain optional. The body-only older-stored-markers item is now addressed for the reply path by the new guide clause; only the marker-row wording gap remains.
Verdict. REQUEST_CHANGES. One P2: the new §8 exception contradicts the requirements page it changes. The rest of the delta is accurate and tested.
|
|
||
| ## 8. Judging a change | ||
|
|
||
| A policy text may ship without the comparison below when its owner records a design rationale in the owner's design. The rationale states what the text asks of the model, why that is expected to help, and where the expectation comes from, such as an earlier product's experience with the same text. It must be logically sound. It stands in for the evaluation until one is run, and any later candidate change to that text is still judged by the rule below. |
There was a problem hiding this comment.
P2, contract contradiction. This line lets a policy text ship without the comparison, but the same requirements page still says the opposite in seven places: :9 and :68 ("every change to it is evaluated"), :15 and :126 ("Each policy text carries one evaluation"), :17 and :179 (a change to a text with no harness must bring its own scenario set, run locally and reported in the pull request), and :27 ("Policy changes on evidence"). The zh page repeats all seven at docs/zh/design/model-prompts.md:9, 15, 17, 27, 68, 126, 179. The new text also says the rationale "stands in for the evaluation until one is run" without naming who runs it or when.
Failure scenario. A contributor adds a policy sentence with a rationale and cites this line. One reviewer applies :68 and :179 and blocks for lack of an evaluation or a scenario set; another applies this line and approves. Both read the same page. This PR already relies on the exception for the two hints at docs/design/plugins/Collaboration.md:38, and it reports no evaluation.
Fix. If the exception stays, update :9, :15, :17, :27, :68, :126, :179 and the zh counterparts to refer to it, and state who runs the deferred evaluation and when. If it does not stay, revert this line and judge the two hints under §8.1 or ship factual guidance.
There was a problem hiding this comment.
Fixed in 62d5ecc. Both language pages now name the exception at :9, :15, :17, :27, :68, :126 and :179, and section 8 names the owner, the two due events (a harness covers the text, or the text changes again) and where the rationale is tracked. The Collaboration rationale at docs/design/plugins/Collaboration.md:38 (zh :36) states what the hints ask, why they are expected to help and where the expectation comes from. No remaining blocker.
…e is stated The section 8 exception contradicted seven statements on the same page that every policy change is evaluated. They now name the exception, and section 8 says who runs the deferred evaluation, when it is due and where the deferral is tracked. The Collaboration guide row names the sentence its "rest of" clause refers to.
|
@yyhhyyyyyy thanks. The P2 is fixed in §8 exception vs. the rest of model-prompts. All seven statements now name the exception, in both en and zh: lines 9, 15, 17, 27, 68, 126 and 179. Each says a policy change is evaluated, or ships on a recorded design rationale until it is. §8 now also states:
The page therefore gives one rule, and a reviewer applying any of those lines reaches the same verdict. P3s addressed in passing.
CI. |
zerob13
left a comment
There was a problem hiding this comment.
Approved at 62d5eccffc30c06745b69e89326bbbb0c6b0b3e1. The docs now consistently reflect the accepted §8 exception in English and Chinese: the owner must run the deferred comparison when the harness first covers the text or when the text next changes, whichever comes first. Collaboration records the rationale and uses the same rule. The classification edit leaves the model-facing message unchanged. Exact merge CI passed the Linux workspace, macOS native, Windows CLI and ci-ok jobs, including the affected Collaboration coverage. The earlier timeout cause was not established.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Scope. This PR clarifies the leader's agent declaration and the request/message semantics: optional profile.tools and profile.systemPrompt with factual descriptions, AgentProfile.system_prompt with #[serde(default)], an omitted message mode defaulting to steer, the request relation separated from the message relation, the sender's name and session in the marker, a guide reply clause for messages without a session attribute, and a recorded rationale for the two leader hints. I reviewed the full origin/main...62d5eccf diff, every thread, both languages, and the sections the new text cites.
Prior P2, fixed. The round 4 P2 on docs/design/model-prompts.md:143 is resolved at 62d5eccf. The seven statements now name the exception at docs/design/model-prompts.md:9, 15, 17, 27, 68, 126, 179 and docs/zh/design/model-prompts.md:9, 15, 17, 27, 68, 126, 179. Section 8 states the owner, the two due events (a harness covers the text, or the text changes again) and where the rationale is tracked; both languages agree. The Collaboration rationale at docs/design/plugins/Collaboration.md:38 (zh :36) states what the two hints ask, why they are expected to help and where the expectation comes from. I found no remaining contradiction between the exception and the rule statements on either page.
Defaults and field semantics, verified.
- Omitted
profile.tools: the schema requires onlynameanddescription(crates/dim-app-server/src/collaboration.rs:3434-3443),session_configcopiesprofile.tools(crates/dim-app-server/src/agents.rs:73-76), soNoneleaves no mount list andToolRegistrydeclares the full set (crates/dim-agent-capabilities/src/tool_registry.rs:314-343); the bare test asserts it (crates/dim-app-server/tests/transport_flow/agents.rs:664-678). - Omitted
profile.systemPrompt:#[serde(default)](crates/dim-agent-types/src/profile.rs:17-18), andsession_entryreturns no entry for empty text (crates/dim-agent-capabilities/src/prompt_sources.rs:147-156); the same test asserts the request system starts with the guide (crates/dim-app-server/tests/transport_flow/agents.rs:674-678). - Omitted message
mode:CollaborationMessageModedefaults toSteer(crates/dim-agent-types/src/events.rs:1182-1186), the action field defaults (crates/dim-app-server/src/collaboration.rs:3352-3358), and delivery maps it toInputMode::Steer(:2092-2096); the flow test sends a message without mode and assertssteer(crates/dim-app-server/tests/transport_flow/collaboration.rs:1795-1817). - The marker relations match the code: the leader request at
crates/dim-app-server/src/collaboration.rs:2301, the leader and member relations at:2711-2724, the sender attributes at:2733-2743; the new frames pin the member-to-leader and leader frames (crates/dim-app-server/tests/transport_flow/collaboration.rs:1814,:1905-1908). The guide reply clause matches the shipped entry (crates/dim-app-server/src/collaboration.rs:3548), andlistreturns each participant'sagentIdandsessionId(:1403).
P3, optional: classification overbreadth. docs/design/plugins/Collaboration.md:15 (zh :13) says every property description states a fact and carries no policy. Under the model-prompts section 4 test, "Short" (crates/dim-app-server/src/collaboration.rs:3440), "in one short line" (:3449) and "omit it on a fresh read" (:3429) are advisory; "To narrow it, use tool names exactly as they are declared to you." (:3453) is quoted by the row and is guidance too. Failure scenario: an editor changes one of these hints without the evaluation model-prompts section 8 requires, citing the Protocol class, and a reader of section 3 concludes only the two descriptions are policy. Fix: delete the advisory phrases or narrow the claim to the descriptions that state schema facts and accepted values, and align the PR body's "Property descriptions state only facts."
P3, optional: sender name. crates/dim-app-server/src/collaboration.rs:2741 renders sender.profile.name, but the name schema (:3446-3447) and agent.create (crates/dim-app-server/src/agents.rs:2077-2085) accept an empty name or a line break, and crates/dim-agent-capabilities/src/context_block.rs:35-41 escapes only &, < and >. Failure scenario: an Agent created with {"name":"","description":""} yields Agent , a member of your team, sent you this message:, against the Protocol claim at docs/design/plugins/Collaboration.md:19 that the sentence names the sender. Fix: require a nonblank single-line name at the boundary, or fall back to sender.agent_id and flatten line breaks.
P3, optional: test gaps. The bare profile test covers creation but not the session.agent.update use of session_entry (crates/dim-agent-capabilities/src/prompt_sources.rs:147-156, called at crates/dim-app-server/src/agents/configuration.rs:301), and the member-to-teammate relation (crates/dim-app-server/src/collaboration.rs:2722) and the approval-denial send (crates/dim-app-server/src/collaboration/approvals.rs:251) are not asserted. Failure scenario: a mutation that makes a teammate message read "a member of your team", or that adds a role prompt on the update path, passes the suite. Fix: add a teammate message frame and an update-path assertion.
P3, optional: type doc and legacy marker. crates/dim-agent-types/src/profile.rs:17-18 adds #[serde(default)] without a doc for the omission contract, and docs/design/plugins/Collaboration.md:19 lists the marker's sender attributes as agent and session without saying that a stored message from before this change has only agent; the guide row at :20 handles the reply path. Failure scenario: a reader does not learn the omission or legacy behavior; no runtime failure. Fix: one line in each place.
Cross-PR and merge. git merge-tree is clean against origin/main 30421b4 and the current heads of #2174 47233dc, #2197 dc94f53, #2202 08b73bf, #2206 68ff011, #2208 7b1103a, #2220 c70fc90, #2225 a9116c4 and #2226 244d231. Once #2197 lands, "the full tool set" should be read as the mode's visible set and this page's wording rechecked; no change needed now.
Verification. cargo test --locked -p dim-app-server --test transport_flow -- agents:: collaboration::: 74 passed, 0 failed, 1 ignored. cargo test --locked -p dim-agent-types: 10 lib tests and 48 contract tests passed. node scripts/adr-check.mjs --base origin/main: passed, 10 changed files. CI at 62d5eccf: changes, macos-native, windows-cli, verify (linux) and ci-ok passed; the other jobs were skipped by path filters. No residual test processes from this review. The worktree is clean at 62d5eccf.
Unverified. The claim about the previous TypeScript product (person names were well received, a role prompt was often unhelpful) is the recorded rationale, not measured evidence in this repository, and the deferred evaluation does not exist. I ran the two target flows, not the full suite. The #2197 tool-mode effect is future.
Old items. Withdraw the round 4 P2; it is fixed. The two earlier P2s remain fixed. The P3 items from the earlier threads remain optional; the EN "rest of that sentence" wording and the PR body's stale Permission and quote points are fixed.
Verdict. APPROVE. The prior P2 is fixed, the documented defaults and field semantics match the code, and the remaining items are optional P3s.
Why
The
agenttool told the model how to call it, but not what several of its parts mean.profile.toolsandprofile.systemPromptwere required and undocumented, so a leader invented a tool list for every temporary member. Names it could not resolve were dropped with only a debug log (tool.attachunavailable:<name>), and the member then failed withUnknown tool: ….This PR states those facts in the model-facing text and adds only light hints. It adds no new delegation guidance.
Changes
Profile schema (leader
agent)profile.tools: optional.Optional. Omit to give the member the full tool set. To narrow it, use tool names exactly as they are declared to you.profile.systemPrompt: optional.Standing guidance and knowledge the role must keep following. It stays with the Agent for its whole life; the task itself goes in prompt.profile.name:The name the user knows this Agent by and refers to it with.A person's name that fits the user's language and region works well as its name. Give it a systemPrompt only when the role truly needs standing guidance.profile.description:What this Agent is for, in one short line.prompt:The message that gives the member this task. A new member starts from this message alone.Request and message
usually omit its tools,to replace a running task, cancel it and request again, andMembers cannot delegate.steer;appendstays available. Both roles' message bullets state how each mode reaches an idle receiver, and the leader's says a messagestarts no task and returns no result; give new work with request.your team leader, sent you this message. Only a request keepsassigned you this work.When you finish a task, your last reply is the result the leader receives; do not send it as a message.A message-started turn returns no result, so the sentence is scoped to a task.dim-agent-messagecarriessessionbesideagent, and its relation sentence names the sender's Agent from the receiver's side:Agent <name>, a member of your team, sent you this message:for a member writing to its leader. The guide entry addsTo reply, pass its agent and session attributes as agentId and sessionId. Without a session attribute, find the sender in list; never guess its session.Type
AgentProfile.system_promptgets#[serde(default)]. An empty prompt already skipped thedim/sessionentry, so leaving it out behaves the same as"". Records are still written with the field, so the stored format does not change.CollaborationMessageModenow defaults toSteer. Storedcollaboration/messageevents always carry their mode, so existing records read the same.Docs: the sentence-classification table in Collaboration (en and zh) lists the new Protocol facts and Policy hints, and the leader-message relation sentence.
Decisions
profile.toolsgives the full tool set. This is intended. A temporary member without a list declares its Session's full set, which can be wider than a leader's narrowed mount list. Permission is inherited as before and the member's own Approval routes its asks to the leader, so this changes declarations, not authorization. An explicit list, including[], still narrows the set.modeissteer. This is intended. A message is information the receiver should act on now, so by default it wakes an idle receiver.appendstays available for context that can wait. Storedcollaboration/messageevents always carry their mode, so existing records read the same.AgentProfile.system_prompt. The model learns that it may be omitted from the schema (it is not inrequired, and its description states its use). A Rust doc comment would only restate#[serde(default)].Verification
cargo test --locked -p dim-app-server --test transport_flow -- agents:: collaboration::passes.cargo test --locked -p dim-agent-typespasses.nameanddescription;agent.createaccepts a profile withoutsystemPromptortools;modeis delivered assteer.agent,sessionand thea member of your teamrelation.toolsdeclares the full set rather than the default mount list, and one withoutsystemPromptadds no role prompt (first model request);Not in scope
profile.toolsnames when a request is made, instead of dropping them.readwith expandable details: 抽取叙事投影组件,让 agent read 复用 recall 的分层读法 #2221.