Skip to content

fix: backport upstream trivial bug fixes (#3499, #3630, #3320)#109

Merged
mabry1985 merged 1 commit into
devfrom
chore/backport-trivial-fixes
Apr 26, 2026
Merged

fix: backport upstream trivial bug fixes (#3499, #3630, #3320)#109
mabry1985 merged 1 commit into
devfrom
chore/backport-trivial-fixes

Conversation

@mabry1985

@mabry1985 mabry1985 commented Apr 26, 2026

Copy link
Copy Markdown

Summary

Cherry-picks 3 self-contained bug fixes from upstream QwenLM/qwen-code:

Test plan

  • 120 affected tests pass locally
  • CI green

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Optimized skill directory monitoring with improved filtering to exclude special files and nested directories.
  • Bug Fixes

    • Fixed assistant message content handling in OpenAI-compatible conversions when reasoning is present.
    • Improved telemetry serialization to properly handle circular object references.

…wenLM#3320)

Cherry-picked from QwenLM/qwen-code:

- QwenLM#3499 fix(core): use empty string instead of null for reasoning-only
  assistant content. Some OpenAI-compatible providers (e.g. Ollama
  qwen3.5:9b) reject content: null with HTTP 400 when reasoning_content is
  also present. Tool-call-only messages keep null per OpenAI spec.

- QwenLM#3630 fix(telemetry): switch FileExporter.serialize from JSON.stringify
  to safeJsonStringify. OTel ReadableSpans hold a BatchSpanProcessor
  back-reference that forms a cycle and crashed --telemetry-outfile users.

- QwenLM#3320 fix(core): cap chokidar depth at 2 in SkillManager and skip
  .git / special file types. Prevents FD exhaustion when a skill dir
  contains node_modules etc., which silently broke node-pty I/O.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mabry1985 mabry1985 merged commit 6e1702d into dev Apr 26, 2026
1 of 3 checks passed
@mabry1985 mabry1985 deleted the chore/backport-trivial-fixes branch April 26, 2026 07:09
@coderabbitai

coderabbitai Bot commented Apr 26, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 000a4d4d-47ec-413a-b991-2aa3f4350ce4

📥 Commits

Reviewing files that changed from the base of the PR and between 3cea3ab and dd3009b.

📒 Files selected for processing (6)
  • packages/core/src/core/openaiContentGenerator/converter.test.ts
  • packages/core/src/core/openaiContentGenerator/converter.ts
  • packages/core/src/skills/skill-manager.test.ts
  • packages/core/src/skills/skill-manager.ts
  • packages/core/src/telemetry/file-exporters.test.ts
  • packages/core/src/telemetry/file-exporters.ts

Walkthrough

This pull request introduces three independent enhancement areas: (1) OpenAI content generator now returns empty string for assistant messages with reasoning but no visible text, (2) skill manager exports watcher configuration constants and ignore logic for chokidar file watching, and (3) telemetry file exporter uses safe JSON serialization with circular reference handling.

Changes

Cohort / File(s) Summary
OpenAI Content Generation
packages/core/src/core/openaiContentGenerator/converter.ts, packages/core/src/core/openaiContentGenerator/converter.test.ts
Logic now returns empty string ("") for assistant content when reasoning parts exist without text, instead of null, while preserving null for tool-call-only messages. Test coverage added for reasoning-only, tool-only, and mixed content scenarios.
Skill Manager Watcher Configuration
packages/core/src/skills/skill-manager.ts, packages/core/src/skills/skill-manager.test.ts
Exports new constant WATCHER_MAX_DEPTH and function watcherIgnored() to filter non-file/non-directory nodes and paths containing .git. Watcher setup integrates these options to limit watch depth and ignore irrelevant filesystem events. Tests verify ignore logic and watcher option configuration.
Telemetry Serialization
packages/core/src/telemetry/file-exporters.ts, packages/core/src/telemetry/file-exporters.test.ts
Replaces JSON.stringify with safeJsonStringify for handling circular references in telemetry payloads. New test verifies serialization handles circular object references and preserves span metadata with proper formatting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/backport-trivial-fixes

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant