-
-
Notifications
You must be signed in to change notification settings - Fork 647
merge dev #1423
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
Merged
Merged
merge dev #1423
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
3540f73
Agent test harness: routing cases, authored history, scope narrowing,…
marsyusms 46a8116
Clear run history: select-all and delete
marsyusms c8f6319
Merge master, and give the three MainTest hooks a SelfId
marsyusms dac2c5d
Merge pull request #1411 from yileicn/master
yileicn 0ff995e
Add FloxiAI plugin: core classes, DI, and provider reg
Oceania2018 ff0330f
Agent test harness: conversational case authoring (POST /agent-test/a…
marsyusms d47d163
Merge pull request #1409 from yuyixg/feature/agent-test-set-p1
iceljc 4f0de87
Agent test: count utilities as mock targets
marsyusms f17e941
Let the host adjust the headers an MCP connection is opened with
marsyusms 669d22f
Merge pull request #1413 from yuyixg/feature/mcp-client-header-provider
yileicn aadb4ef
Pool MCP connections per scope, keyed by the identity they carry
marsyusms cd1a1df
Merge branch 'SciSharp:master' into feature/mcp-client-header-provider
yuyixg 628cdb0
Share the HTTP connection under MCP clients, not the clients themselves
marsyusms 079846c
Merge pull request #1412 from yuyixg/feature/agent-test-set-p1
yileicn 473d01e
allow execute rules for each agent
111a824
minor change
5409af5
Merge pull request #1415 from iceljc/master
iceljc 8e809ee
Merge pull request #1416 from yileicn/master
yileicn 94438c6
Run triggered rules in parallel with per-rule service scopes
41cc3ec
Carry started conversation ids on rule trigger cancellation
7074a2e
change agent llm
6cc200b
Run triggered rules sequentially again
1f58c19
Report every tool call a reply asked for, not only the first
marsyusms a2ec1fb
Store what an agent said to itself without showing it
marsyusms d49f0ee
Merge pull request #1417 from iceljc/feature/rule-engine-parallel-exe…
iceljc 272cd86
GTR-13432
6be256a
Merge branch 'SciSharp:master' into master
adenchen123 bfa981a
Merge pull request #1418 from adenchen123/master
yileicn 584bb58
Reuse a server's tool listing instead of listing it on every agent load
marsyusms 6708348
Merge branch 'SciSharp:master' into feature/mcp-client-header-provider
yuyixg 4a42e72
Merge pull request #1414 from yuyixg/feature/mcp-client-header-provider
yileicn 8056ed4
GTR-13432
d850464
Merge branch 'master' of https://github.com/adenchen123/BotSharp
f936f92
Merge pull request #1419 from adenchen123/master
yileicn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/Infrastructure/BotSharp.Abstraction/Conversations/ISyntheticConversationProbe.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| namespace BotSharp.Abstraction.Conversations; | ||
|
|
||
| /// <summary> | ||
| /// Reports whether a conversation is synthetic -- driven by an automated harness rather than by a | ||
| /// person -- so that guards aimed at human overuse can stand aside for it. | ||
| /// | ||
| /// This exists because per-user volume limits count the wrong thing for a test harness. A regression | ||
| /// suite legitimately opens one conversation per case per model, at machine speed, and does it under | ||
| /// whatever identity the background worker happens to have. Measured as human behaviour that looks | ||
| /// like abuse, and the limit then fails every test with a message about conversation quotas -- which | ||
| /// says nothing about the agent under test and is indistinguishable, in a report, from the agent | ||
| /// having regressed. | ||
| /// | ||
| /// Deliberately a query rather than a flag on the message: a flag would have to be threaded through | ||
| /// every call that creates or continues a conversation, and anything that forgot would silently be | ||
| /// treated as human traffic. Asking by conversation id keeps the answer in one place. | ||
| /// | ||
| /// Implementations must be cheap and side-effect free -- this is called on the message path -- and | ||
| /// must answer false for anything they do not recognise. Several may be registered; a conversation is | ||
| /// synthetic if any of them claims it. None being registered is the normal case, and then nothing is | ||
| /// exempt. | ||
| /// </summary> | ||
| public interface ISyntheticConversationProbe | ||
| { | ||
| /// <summary> | ||
| /// True when this conversation is being driven by a harness. Must not throw, and must not treat | ||
| /// an unknown or blank id as synthetic: getting this wrong in that direction exempts real user | ||
| /// traffic from the very limits it is meant to be held to. | ||
| /// </summary> | ||
| bool IsSynthetic(string conversationId); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/Infrastructure/BotSharp.Abstraction/Functions/Models/LlmToolCall.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| namespace BotSharp.Abstraction.Functions.Models; | ||
|
|
||
| /// <summary> | ||
| /// One tool call in a model's reply. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// A reply can carry several: models routinely ask for independent lookups at once, and every | ||
| /// provider here used to keep only the first. See <see cref="RoleDialogModel.ToolCalls"/> for | ||
| /// how the whole set is carried and how it relates to the single-call fields beside it. | ||
| /// </remarks> | ||
| public class LlmToolCall | ||
| { | ||
| /// <summary> | ||
| /// The provider's id for this call. It is what a tool result has to be sent back under, so | ||
| /// results cannot be matched to calls without it. | ||
| /// </summary> | ||
| public string? Id { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The name exactly as the model produced it, with no normalization applied -- a remote MCP | ||
| /// tool may legitimately have a name that name repair would rewrite. | ||
| /// </summary> | ||
| public string? FunctionName { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Raw JSON arguments. The model does not always produce valid JSON, so parse defensively. | ||
| /// </summary> | ||
| public string? FunctionArgs { get; set; } | ||
|
|
||
| public LlmToolCall() | ||
| { | ||
| } | ||
|
|
||
| public LlmToolCall(string? id, string? functionName, string? functionArgs) | ||
| { | ||
| Id = id; | ||
| FunctionName = functionName; | ||
| FunctionArgs = functionArgs; | ||
| } | ||
|
|
||
| public override string ToString() => $"{FunctionName}({FunctionArgs}) [{Id}]"; | ||
| } |
30 changes: 30 additions & 0 deletions
30
src/Infrastructure/BotSharp.Abstraction/MCP/Services/IMcpClientHeaderProvider.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| namespace BotSharp.Abstraction.MCP.Services; | ||
|
|
||
| /// <summary> | ||
| /// An optional host hook over the HTTP headers used to open one MCP server connection. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Nothing registers this by default. With no implementation registered the headers configured | ||
| /// under <c>MCP:McpServerConfigs</c> are used verbatim, which is the only behaviour there was | ||
| /// before the hook existed — a host that does not implement it sees no change at all. | ||
| /// <para> | ||
| /// It exists so a host can call a server as whoever is driving the conversation instead of with | ||
| /// one fixed credential. That decision belongs to the host: it is the only side that knows what | ||
| /// a caller's credential is and which servers may be shown it. | ||
| /// </para> | ||
| /// </remarks> | ||
| public interface IMcpClientHeaderProvider | ||
| { | ||
| /// <summary> | ||
| /// Answers the headers to send to <paramref name="serverId"/>. | ||
| /// </summary> | ||
| /// <param name="configured"> | ||
| /// The headers from configuration. This dictionary is shared for the lifetime of the process, | ||
| /// so an implementation that changes a header MUST copy it rather than write into it. | ||
| /// </param> | ||
| /// <returns> | ||
| /// The headers to send. Returning <paramref name="configured"/> unchanged is the no-op answer, | ||
| /// and is the answer expected for any server the implementation does not recognise. | ||
| /// </returns> | ||
| Dictionary<string, string>? GetHeaders(string serverId, Dictionary<string, string>? configured); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Infrastructure/BotSharp.Abstraction/Rules/RuleTriggerCanceledException.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| using System.Threading; | ||
|
|
||
| namespace BotSharp.Abstraction.Rules; | ||
|
|
||
| /// <summary> | ||
| /// Thrown when a rule trigger is cancelled part way through. Rules that already started a | ||
| /// conversation cannot be undone, so their ids are carried on the exception and the caller | ||
| /// can still act on them (or ignore them) while seeing the run as cancelled. | ||
| /// </summary> | ||
| public class RuleTriggerCanceledException : OperationCanceledException | ||
| { | ||
| /// <summary> | ||
| /// Conversations that were created before the run was cancelled. Never null. | ||
| /// </summary> | ||
| public IReadOnlyList<string> ConversationIds { get; } | ||
|
|
||
| public RuleTriggerCanceledException( | ||
| IReadOnlyList<string> conversationIds, | ||
| CancellationToken cancellationToken, | ||
| Exception? innerException = null) | ||
| : base($"Rule trigger was cancelled after starting {conversationIds.Count} conversation(s).", innerException, cancellationToken) | ||
| { | ||
| ConversationIds = conversationIds; | ||
| } | ||
| } |
2 changes: 1 addition & 1 deletion
2
src/Infrastructure/BotSharp.Core.Rules/Controllers/RuleController.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
4. Parallel tool calls ignored
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools