- Werkzeugkontext kennt Lauf und Aufgabe des Laufs (RunId, RunTaskId); die Delegationskette traegt den Lauf des Aufrufers weiter (RunId, CallerRunId) - Aufgaben tragen origin_run / origin_task (Datei, DB, Taskboard "Arose from"), gestempelt, nie vom Agenten behauptet - Kommentare nennen den Lauf, in dem sie geschrieben wurden - Laufbeleg: CallerRunId; Laufansicht fuehrt zu "Delegiert von" und "Delegiert an" - #677: task_update ersetzt den Rumpf nicht mehr, Abnahmekriterien aendert nur der Ersteller; Kommentare der Fremdinhalt-Stufe auf fremden Aufgaben kommen gerahmt an - WebUI: Herkunft auf der Aufgabenkarte mit Link zum Lauf Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3f90e0d0cd
commit
f812dbd856
@@ -46,6 +46,12 @@ public sealed record AgentToolContext(
|
||||
/// #715: The calling agent's trust tier, from its tools. Tools that let an agent write to
|
||||
/// someone above it check the way up here. Standard in tests and outside the engine.
|
||||
/// </summary>
|
||||
/// <summary>#697: The run this call belongs to — for stamping where something came from.</summary>
|
||||
public string? RunId { get; init; }
|
||||
|
||||
/// <summary>#697: The task that run works on, if it was started for one.</summary>
|
||||
public string? RunTaskId { get; init; }
|
||||
|
||||
public global::ClawdDotNet.Core.Organisation.AgentTrust Trust { get; init; }
|
||||
= global::ClawdDotNet.Core.Organisation.AgentTrust.Standard;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,28 @@ public sealed class DelegationChain
|
||||
{
|
||||
private readonly string[] _agents;
|
||||
|
||||
private DelegationChain(string[] agents) => _agents = agents;
|
||||
private DelegationChain(string[] agents, string? runId = null, string? callerRunId = null)
|
||||
{
|
||||
_agents = agents;
|
||||
RunId = runId;
|
||||
CallerRunId = callerRunId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// #697: The run of the last agent in the chain — the one that is handing on. Stamped by
|
||||
/// the engine when it builds a tool's context, so a delegated run can name the run it
|
||||
/// came from. <c>null</c> outside a run.
|
||||
/// </summary>
|
||||
public string? RunId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// #697: The run of the agent before the last — the run a delegated run was started from.
|
||||
/// Carried over by <see cref="Append"/>, so the new run can record its origin.
|
||||
/// </summary>
|
||||
public string? CallerRunId { get; }
|
||||
|
||||
/// <summary>#697: The same chain, stamped with the run of its last agent.</summary>
|
||||
public DelegationChain WithRun(string runId) => new(_agents, runId, CallerRunId);
|
||||
|
||||
/// <summary>Der Anfang: ein Lauf, den niemand delegiert hat.</summary>
|
||||
public static DelegationChain Root(string agentId) => new([agentId]);
|
||||
@@ -49,7 +70,7 @@ public sealed class DelegationChain
|
||||
|
||||
/// <summary>Die Kette mit einem weiteren Agenten am Ende.</summary>
|
||||
public DelegationChain Append(string agentId)
|
||||
=> new([.. _agents, agentId]);
|
||||
=> new([.. _agents, agentId], runId: null, callerRunId: RunId); // the new agent's run is not known yet
|
||||
|
||||
/// <summary>Für Meldungen und Protokoll: <c>A -> B -> C</c>.</summary>
|
||||
public override string ToString() => string.Join(" -> ", _agents);
|
||||
|
||||
Reference in New Issue
Block a user