Skip to content

[codex] Add session pattern config diagnostics#376

Merged
jalehman merged 1 commit into
Martian-Engineering:mainfrom
electricsheephq:codex/373-config-diagnostics
Apr 10, 2026
Merged

[codex] Add session pattern config diagnostics#376
jalehman merged 1 commit into
Martian-Engineering:mainfrom
electricsheephq:codex/373-config-diagnostics

Conversation

@100yenadmin

@100yenadmin 100yenadmin commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Closes #373

Summary

  • add source diagnostics for ignoreSessionPatterns and statelessSessionPatterns
  • warn explicitly when env-backed pattern arrays replace plugin-config arrays
  • carry config diagnostics into the engine so startup banners can attribute pattern sources
  • extend config and plugin-registration tests for diagnostics, precedence, and logging

Why

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 test
  • stacked validation branch: npm test
  • isolated OpenClaw 2026.4.9 profile startup logged the full ignore/stateless pattern set from plugin config and showed the profile-local LCM DB path

Companion OpenClaw issue: openclaw/openclaw#64457

@100yenadmin 100yenadmin marked this pull request as ready for review April 10, 2026 18:35
Copilot AI review requested due to automatic review settings April 10, 2026 18:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@100yenadmin

Copy link
Copy Markdown
Collaborator Author

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:

  • branch: existing npm test pass still stands
  • refreshed stacked branch (#375 + #376 + #377): 39 files / 671 tests passed
  • latest OpenClaw main host build daeb749 in an isolated profile with the stacked plugin logged the resolved session pattern sources from plugin config (ignoreSessionPatterns and statelessSessionPatterns) and then behaved correctly at runtime: ignored workspace-support produced 0/0 rows in the fresh LCM DB, while allowed agent:lcm-smoke:main produced 1 conversation and 2 messages

Maintainer note: this PR is independent and is still the observability slice of the stack.

@jalehman jalehman self-assigned this Apr 10, 2026
@jalehman jalehman force-pushed the codex/373-config-diagnostics branch from 2d1cd73 to a70df05 Compare April 10, 2026 23:00
@jalehman jalehman merged commit 06a05e5 into Martian-Engineering:main Apr 10, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 10, 2026
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.

Resolved ignore patterns and session identity failures are not observable enough to debug safely

3 participants