fix: add missing isForkSubagentEnabled from main merge#4731
Conversation
📋 Review SummaryThis PR is described as a follow-up to #4730 to restore 🔍 General Feedback
🎯 Specific Feedback🔴 Critical
🟡 High
🟢 Medium
🔵 Low
✅ Highlights
RecommendationThis PR needs to be split. The stated purpose is "add missing isForkSubagentEnabled from main merge," but the diff includes:
Suggested action: Create a minimal PR with only:
Move all other changes to their respective feature/fix PRs with proper context and test coverage. |
There was a problem hiding this comment.
Pull request overview
Restores configuration and gating surfaces that were lost during a merge conflict resolution, ensuring fork-subagent enablement can be queried consistently and telemetry runtime config matches what the core telemetry SDK expects.
Changes:
- Add
Config.isForkSubagentEnabled()with an env-var override (QWEN_CODE_ENABLE_FORK_SUBAGENT=1) and plumbforkSubagentEnabledthroughConfigParameters. - Add
isForkSubagentEnabled(config)helper export infork-subagent.ts(gated by both fork flag and interactive mode). - Extend
TelemetryRuntimeConfigwithisInteractive()andgetOutboundCorrelationPropagateTraceContext(), and implement them for the daemon telemetry runtime config; removehttpAcpBridge.test.ts.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/tools/agent/fork-subagent.ts | Adds exported helper to decide whether fork-subagent behavior is enabled. |
| packages/core/src/telemetry/runtime-config.ts | Extends telemetry runtime config interface with two required methods. |
| packages/core/src/config/config.ts | Adds forkSubagentEnabled parameter/field and isForkSubagentEnabled() method with env override. |
| packages/cli/src/serve/runQwenServe.ts | Implements new telemetry runtime-config methods for the daemon telemetry config. |
| packages/cli/src/serve/httpAcpBridge.test.ts | Removes the obsolete large test file from the CLI package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| telemetry.resourceAttributeWarnings ?? [], | ||
| getCliVersion: () => cliVersion, | ||
| getSessionId: () => daemonSessionId, | ||
| isInteractive: () => false, | ||
| getOutboundCorrelationPropagateTraceContext: () => false, |
Add isForkSubagentEnabled() to Config class and fork-subagent.ts, brought in by main but lost during merge conflict resolution.
21cfdfe to
b1590e6
Compare
| return this.cronEnabled; | ||
| } | ||
|
|
||
| isForkSubagentEnabled(): boolean { |
There was a problem hiding this comment.
[Suggestion] Config.isForkSubagentEnabled() and the free function isForkSubagentEnabled(config) in fork-subagent.ts share the same name but have different semantics — this method only checks env-var + config-field, while the free function additionally gates on config.isInteractive(). All current callers use the free function so there's no active bug, but the identical naming makes it easy for future code to call the Config method directly and bypass the interactive-mode guard.
Note: isCronEnabled() is fully self-contained in Config (no wrapper), making this two-layer pattern unique to fork-subagent.
Consider moving the isInteractive() check into this method itself (Config already has isInteractive() at line 3744), so the method has complete semantics. The free function can then become a pass-through or be removed entirely.
— qwen3.7-max via Qwen Code /review
Summary
isForkSubagentEnabled()method toConfigclass with env var gate (QWEN_CODE_ENABLE_FORK_SUBAGENT=1)forkSubagentEnabledparam and private field toConfigisForkSubagentEnabled()fromfork-subagent.tsThese were in main but lost during the #4490 merge conflict resolution. Follow-up to #4730.
Test plan
npm run buildexit 0)🤖 Generated with Qwen Code