Repository navigation
fix(dotnet): preserve ordinary chat and shared-state answers (PNI-700) - #7990
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Snapshot validation and phase history examples/integrations/ms-agent-framework-dotnet/agent/SharedStateAgent.cs, examples/integrations/ms-agent-framework-dotnet/agent-tests/Program.cs |
The agent validates the proverbs array, merges it into the caller’s state, and manages first-phase history based on snapshot validation. Regression cases cover state parsing, fallback, and stored history. |
Answer pipeline and tool-call handling examples/integrations/ms-agent-framework-dotnet/agent/SharedStateAgent.cs, examples/integrations/ms-agent-framework-dotnet/agent/Program.cs, examples/integrations/ms-agent-framework-dotnet/agent-tests/Program.cs |
The answer phase uses a constructed pipeline, marks function calls informational, and disposes the owned pipeline after iteration. Regression cases cover tool handling, provider responses, and pipeline lifecycles. |
Regression harness and workflow examples/integrations/ms-agent-framework-dotnet/agent-tests/*, examples/integrations/ms-agent-framework-dotnet/agent/ProverbsAgent.csproj, .github/workflows/test_ms-agent-dotnet-starter-regression.yml |
The executable project and internal visibility support the regression harness. The pull-request workflow restores, builds, and runs the executable for changes to the specified paths. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Bug fix
Suggested reviewers: jpr5, mikeryandev
Merge Risk: 
Minimal · up to d6bb6
-
The change routes ordinary and malformed state through normal chat, keeps structured edits for valid proverbs state, and adds regression coverage plus a PR workflow. No concrete merge-blocking issue was identified in the supplied material. Normal CI results on the final head are still the remaining check.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "fix(dotnet): preserve ordinary chat and shared-state answers (PNI-700)" matches the main change. The objectives say empty, unrelated, and malformed object-valued state now routes through ordinary chat, while valid proverbs state keeps structured edits and the caller's other fields. The summary shows the SharedStateAgent changes that implement this, plus the new regression harness and CI workflow. The title is specific, uses a conventional commit prefix, and omits the CI and test additions, which the objectives treat as largely regression coverage. That omission is acceptable because the title targets the primary behavior fix.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 4.08% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 49 functions across 3 files. (3 skipped: 3 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Size Change: 0 B Total Size: 1.88 MB ℹ️ View Unchanged
|
776d736 to
d6bb624
Compare
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/channels
@copilotkit/channels-core
@copilotkit/channels-discord
@copilotkit/channels-intelligence
@copilotkit/channels-slack
@copilotkit/channels-teams
@copilotkit/channels-ui
@copilotkit/channels-whatsapp
@copilotkit/core
@copilotkit/intelligence-langgraph
@copilotkit/intelligence-mastra
@copilotkit/learning
@copilotkit/mcp-apps-renderer
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
jpr5
left a comment
There was a problem hiding this comment.
Approved at exact head d6bb624.
What I checked:
- Ordinary chat: state that is missing, empty, unrelated or malformed now goes straight to the inner agent. Options, session and cancellation are unchanged. Only a valid
proverbsstring array triggers the two-phase path. - Shared-state edits: the published state merges the new
proverbsinto the caller's other fields. The answer phase sees that merged state and the user's original request. - Answer-phase tool block: the answer run uses ToolMode.None. It sends declaration-only tool shadows. The provider boundary also marks every FunctionCallContent as InformationalOnly, below both the configured invoker and a caller-factory invoker. The tests use the real SDK FunctionInvokingChatClient with configured, AdditionalTools and caller-factory placements. They assert the mutator runs zero times after the snapshot is published, and that tools in the first phase still run.
- History: PhaseHistoryProvider records each logical turn once. It defers the first phase and commits it only on fallback. The per-run answer pipeline is disposed without disposing the shared provider.
- Fallback: an invalid snapshot replays the withheld text, and forwards each tool update once.
- Scope: only the .NET starter, its new test project, and a pull_request-only workflow (contents: read, pinned actions). The Dockerfiles copy only agent/, so the tests are not in the image. There are no deploy, Showcase auto-deploy or pin changes.
CI at this head: 61 pass, 5 conditional skips, 0 pending, 0 failed. This includes the new regression job (67/67 assertions), build-check, smoke-starter and smoke-starter-production-image for ms-agent-framework-dotnet.
Non-blocking nits:
- agent-tests/Program.cs still has an authoring note ("Insert immediately before foreach ... All existing 46 cases ...") that could be removed.
- If the model still emits a tool call in the answer phase, the call is not executed, but it is still streamed to the client as informational. With ToolMode.None this is unlikely.
- When the snapshot is valid, the first phase's tool calls are dropped from persisted history. Only request and answer are stored. That matches the stated logical-turn design.
❌ Showcase Build FailedThe Docker build triggered by this PR's merge failed. Run: https://github.com/CopilotKit/CopilotKit/actions/runs/40378332870 @contextablemark — please check the build logs and fix the issue. |
Fixes PNI-700.
The .NET starter currently replaces ordinary chat with an empty-proverbs summary whenever a request carries object-valued state. This change routes empty, unrelated and malformed state through ordinary chat, while valid proverbs state retains structured edits and the caller's other fields. The answer receives the full updated state and answers the user's request.
The wrapper preserves caller options and framework-managed conversation history, records each logical turn once, retains complete fallback responses, and prevents tools from executing during the answer-only phase through the configured forwarding middleware pipeline. It disposes each owned answer pipeline without disposing the shared provider.
Validation: 67 provider-free regression assertions compile with zero warnings/errors and pass against the exact final source; shell-docs 511/511 assertions, the actual .NET Docker publish, and both container fixture lanes pass. The two-commit cleanup preserves all six file blobs and the complete patch; checks will run again on the new head. Local compiler/runtime checks were deferred for Mac memory pressure; normal static hooks remained enabled.
Scope: six files, 1,831 additions / 36 deletions, largely regression coverage (1,473 added test/project lines). The application C# changes are 307 additions / 36 deletions. Process-wide proverb-tool state isolation, continuation/resume, replacement factories that discard the supplied agent, and extra context-provider composition remain separate follow-ups; the supported middleware contract forwards/decorates the supplied agent.
No live service rollout or acceptance is claimed. Production is untouched, staging auto-deploy remains off, current pins stay intact, and this PR does not authorize deployment or re-enabling auto-deploy.
Summary by CodeRabbit