Conversation
Greptile SummaryThis PR closes the gap that prevented the Key changes:
One minor style note: the test file uses a bare top-level Confidence Score: 5/5Safe to merge — the fix is minimal, targeted, and mirrors the existing Discord implementation exactly. All three root causes are properly addressed, the logic in No files require special attention.
|
| Filename | Overview |
|---|---|
| extensions/msteams/src/block-streaming-config.test.ts | New test file with 5 schema validation cases covering true, false, absent, coexistence with blockStreamingCoalesce, and non-boolean rejection. Uses a top-level await import which is unconventional for this codebase (minor style note), but the test logic itself is correct and comprehensive. |
| extensions/msteams/src/monitor-handler/message-handler.ts | Adds disableBlockStreaming to the replyOptions spread, using !msteamsCfg.blockStreaming when the field is explicitly a boolean and undefined otherwise (preserving default fallback). Matches the pattern used by Discord and other channels exactly. |
| src/config/types.msteams.ts | Adds blockStreaming?: boolean with a clear JSDoc comment, placed correctly before blockStreamingCoalesce for logical grouping. |
| src/config/zod-schema.providers-core.ts | Adds blockStreaming: z.boolean().optional() to MSTeamsConfigSchema, closing the schema gap described in the PR. Positioned before blockStreamingCoalesce to match the TypeScript type ordering. |
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/msteams/src/block-streaming-config.test.ts
Line: 4
Comment:
**Prefer a static import over top-level `await import`**
The top-level `await import(...)` at module scope is unusual for this codebase — other test files use normal static imports (or `await import` inside `it()` blocks for mock-isolation purposes). Since the schema file has no side effects that need lazy loading and there's no mock isolation needed here, a regular static import is simpler and more idiomatic:
```suggestion
import { MSTeamsConfigSchema } from "../../../src/config/zod-schema.providers-core.js";
```
If there is a specific circular-dependency or import-chain reason that requires dynamic import, a `beforeAll` block would be more conventional than bare top-level await.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(msteams): wire blockStreaming config..." | Re-trigger Greptile
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| // Import the schema directly to avoid cross-extension import chains | ||
| const { MSTeamsConfigSchema } = await import("../../../src/config/zod-schema.providers-core.js"); |
There was a problem hiding this comment.
Prefer a static import over top-level
await import
The top-level await import(...) at module scope is unusual for this codebase — other test files use normal static imports (or await import inside it() blocks for mock-isolation purposes). Since the schema file has no side effects that need lazy loading and there's no mock isolation needed here, a regular static import is simpler and more idiomatic:
| const { MSTeamsConfigSchema } = await import("../../../src/config/zod-schema.providers-core.js"); | |
| import { MSTeamsConfigSchema } from "../../../src/config/zod-schema.providers-core.js"; |
If there is a specific circular-dependency or import-chain reason that requires dynamic import, a beforeAll block would be more conventional than bare top-level await.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/msteams/src/block-streaming-config.test.ts
Line: 4
Comment:
**Prefer a static import over top-level `await import`**
The top-level `await import(...)` at module scope is unusual for this codebase — other test files use normal static imports (or `await import` inside `it()` blocks for mock-isolation purposes). Since the schema file has no side effects that need lazy loading and there's no mock isolation needed here, a regular static import is simpler and more idiomatic:
```suggestion
import { MSTeamsConfigSchema } from "../../../src/config/zod-schema.providers-core.js";
```
If there is a specific circular-dependency or import-chain reason that requires dynamic import, a `beforeAll` block would be more conventional than bare top-level await.
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a445b68ca1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| // Import the schema directly to avoid cross-extension import chains | ||
| const { MSTeamsConfigSchema } = await import("../../../src/config/zod-schema.providers-core.js"); |
There was a problem hiding this comment.
Keep extension tests inside extension package boundary
extensions/msteams/src/block-streaming-config.test.ts imports ../../../src/..., which escapes extensions/msteams. The repo guideline in AGENTS.md says “inside extensions/<id>/**, do not use relative imports/exports that resolve outside that same extensions/<id> package root.” This introduces a new cross-package dependency that couples the test to core internals and can break package-scoped extension workflows/checks; route this through an extension-local/public runtime barrel instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Wires the blockStreaming configuration option into the Microsoft Teams channel so progressive block-by-block reply delivery can be enabled/disabled consistently with other channels.
Changes:
- Added
blockStreaming?: booleanto the MS Teams Zod config schema. - Added
blockStreaming?: booleanto theMSTeamsConfigTypeScript type. - Passed
disableBlockStreamingthrough the MS Teams dispatch path based onchannels.msteams.blockStreaming. - Added schema validation tests covering valid/invalid
blockStreamingvalues.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/config/zod-schema.providers-core.ts |
Adds blockStreaming to MSTeamsConfigSchema so strict validation accepts it. |
src/config/types.msteams.ts |
Extends MSTeamsConfig type with blockStreaming?: boolean. |
extensions/msteams/src/monitor-handler/message-handler.ts |
Threads disableBlockStreaming into replyOptions to affect block streaming behavior at runtime. |
extensions/msteams/src/block-streaming-config.test.ts |
Adds targeted tests ensuring the schema accepts/rejects blockStreaming correctly. |
d7e23e5 to
d646ddb
Compare
…e delivery The MSTeams channel schema was missing the blockStreaming boolean field, causing channels.msteams.blockStreaming config to fail strict() validation. Additionally, the reply dispatcher never passed disableBlockStreaming through replyOptions. Changes: - Add blockStreaming: z.boolean().optional() to MSTeamsConfigSchema - Add blockStreaming property to MSTeamsConfig type with JSDoc - Wire disableBlockStreaming in reply-dispatcher replyOptions, matching the pattern used by Discord and other channels - Add schema validation tests (5 tests) and reply-dispatcher tests (3 tests) Closes #56041
d646ddb to
831fa57
Compare
…nclaw#56134) - Add blockStreaming and blockStreamingCoalesceDefaults to MSTeams channel plugin (was the only channel missing it) - Wire disableBlockStreaming flag in reply dispatcher from config - Flush pending messages immediately during generation when blockStreaming is enabled - Add comprehensive tests for schema validation and progressive flush behavior Refs openclaw#56041
…nclaw#56134) - Add blockStreaming and blockStreamingCoalesceDefaults to MSTeams channel plugin (was the only channel missing it) - Wire disableBlockStreaming flag in reply dispatcher from config - Flush pending messages immediately during generation when blockStreaming is enabled - Add comprehensive tests for schema validation and progressive flush behavior Refs openclaw#56041
…nclaw#56134) - Add blockStreaming and blockStreamingCoalesceDefaults to MSTeams channel plugin (was the only channel missing it) - Wire disableBlockStreaming flag in reply dispatcher from config - Flush pending messages immediately during generation when blockStreaming is enabled - Add comprehensive tests for schema validation and progressive flush behavior Refs openclaw#56041
…nclaw#56134) - Add blockStreaming and blockStreamingCoalesceDefaults to MSTeams channel plugin (was the only channel missing it) - Wire disableBlockStreaming flag in reply dispatcher from config - Flush pending messages immediately during generation when blockStreaming is enabled - Add comprehensive tests for schema validation and progressive flush behavior Refs openclaw#56041
Summary
blockStreamingto MSTeams config validation and typing sochannels.msteams.blockStreamingis accepted.disableBlockStreaming, ensuring block streaming can be enabled/disabled from channel config.Changes
src/config/zod-schema.providers-core.tsblockStreaming: z.boolean().optional()toMSTeamsConfigSchema.src/config/types.msteams.tsblockStreaming?: booleantoMSTeamsConfig.extensions/msteams/src/monitor-handler/message-handler.tsdisableBlockStreamingthrough dispatch reply options.extensions/msteams/src/reply-dispatcher.tsdisableBlockStreamingin returnedreplyOptions.extensions/msteams/src/block-streaming-config.test.tsblockStreamingschema acceptance/rejection cases.extensions/msteams/src/reply-dispatcher.test.tsdisableBlockStreamingmapping forblockStreaming: true | false | unset.Testing
pnpm vitest run extensions/msteams/Fixes #56041