[codex] Add session pattern config diagnostics#376
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves observability around session-pattern configuration (ignoreSessionPatterns, statelessSessionPatterns) by attributing resolved pattern sets to their sources (env vs plugin config vs defaults) and emitting explicit warnings when env vars replace plugin-config arrays, then propagating that metadata into the engine so startup banners can report it consistently.
Changes:
- Add config-resolution diagnostics for session pattern arrays, including source attribution and “env overrides plugin-config” flags.
- Emit explicit startup warnings when env-backed arrays override plugin-config arrays, and include pattern sources in engine startup banner logs.
- Extend config + plugin-registration tests to cover diagnostics, precedence, and updated log messages.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/db/config.ts |
Introduces resolveLcmConfigWithDiagnostics, pattern-array resolution helpers, and source description utility. |
src/plugin/index.ts |
Switches to diagnostics-aware config resolution and logs env-override warnings once per process. |
src/engine.ts |
Logs ignore/stateless patterns with source attribution (and indicates when stateless enforcement is disabled). |
src/types.ts |
Extends dependencies to optionally carry config diagnostics into the engine. |
src/startup-banner-log.ts |
Adds new startup-banner dedupe keys for env-override warnings. |
test/config.test.ts |
Adds regression coverage for diagnostics output and override flags. |
test/plugin-config-registration.test.ts |
Updates startup banner expectations and adds env-override logging test. |
.changeset/pr373-config-diagnostics.md |
Documents the patch release change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Issue: #373 No code changes were needed after the initial pass here; I kept this PR independent so it remains the diagnostics-quality slice of the stack. The latest stacked validation still exercised the richer source-attributed startup logs from this branch. Validation:
Maintainer note: this PR is independent and is still the observability slice of the stack. |
2d1cd73 to
a70df05
Compare
Closes #373
Summary
ignoreSessionPatternsandstatelessSessionPatternsWhy
The workspace-support incident was harder to debug because runtime logs did not say where the resolved ignore/stateless patterns came from, and env overrides could silently replace plugin-config arrays.
Validation
npm testnpm testCompanion OpenClaw issue: openclaw/openclaw#64457