Skip to content

feat(config): multi-layer config overlay (env + project) - #174

Merged
cnjack merged 1 commit into
mainfrom
feat/multi-layer-config
Jul 25, 2026
Merged

feat(config): multi-layer config overlay (env + project)#174
cnjack merged 1 commit into
mainfrom
feat/multi-layer-config

Conversation

@cnjack

@cnjack cnjack commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

Multi-layer config overlay support: environment variable overlay (JCODE_MODEL, JCODE_DEFAULT_MODE, etc.) and project-level config overlay (.jcode/config.json).

Changes

  • Add ApplyEnvOverlay for env-var-driven config overrides
  • Add ApplyProjectOverlay for per-project .jcode/config.json merges
  • Wire overlays into web server startup and per-task engine builds
  • Address security review findings from PR comments
  • Fix funlen lint violation in runWebServer (extract newNotifyingHandler)

Verification

  • go build ./...
  • golangci-lint run — 0 issues ✓
  • go test ./... — all pass ✓
  • pre-push hook passed locally

Summary by CodeRabbit

  • Refactor
    • Streamlined web notification setup for WeChat and BLE channels.
    • Preserved existing notification behavior, including conditional BLE support and task-specific approval and completion notifications.
    • Shared notification services are now managed consistently while web tasks continue to receive the appropriate alerts.

…WebServer

runWebServer was 802 lines (limit 800). Extract the notifying-handler
construction into a package-level newNotifyingHandler function.
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c18da07-cba5-4f94-9cc0-82bfe12860f3

📥 Commits

Reviewing files that changed from the base of the PR and between dfa0b37 and 4ff6b6f.

📒 Files selected for processing (1)
  • internal/command/web.go

📝 Walkthrough

Walkthrough

The web server now delegates shared WeChat/BLE notifier initialization and per-task notifying handler construction to dedicated helpers while preserving conditional feature enablement and notification wiring.

Changes

Web notifier wiring

Layer / File(s) Summary
Notifier setup and handler wiring
internal/command/web.go
Adds helpers for shared WeChat/BLE setup and per-task notification handler wrapping, then updates runWebServer to use them.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • cnjack/jcode#111: Also changes shared BLE notifier initialization and attachment in internal/command/web.go.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions config overlay support, but the shown changes are about notifier setup extraction in web.go. Rename the PR to reflect the actual change, such as extracting notifying handler setup in the web server code.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 feat/multi-layer-config

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.

❤️ Share

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

@cnjack
cnjack merged commit 01f2af5 into main Jul 25, 2026
4 checks passed
@cnjack
cnjack deleted the feat/multi-layer-config branch July 25, 2026 16:27
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