fix(openclaw): make identity skip filters config-aware for per-agent banking#1054
Merged
nicoloboschi merged 4 commits intomainfrom Apr 14, 2026
Merged
Conversation
…banking When dynamicBankGranularity includes 'agent', each agent should get its own bank — including 'main' and CLI sessions. The existing filters in getIdentitySkipReason() unconditionally rejected agent:*:main sessions, provider 'main', and anonymous senderIds, which prevented per-agent banks from ever being created for the main agent or any CLI-accessed agent. Thread pluginConfig through resolveAndCacheIdentity to getIdentitySkipReason, and when per-agent banking is enabled: - allow agent:*:main sessions through - allow provider 'main' (still skip cron/heartbeat/subagent) - synthesize agent-user:<agentId> for anonymous CLI sessions Default behavior is unchanged when dynamicBankGranularity does not include 'agent'. Fixes #1046
Broaden the carve-out so the same skip-bypass behavior fires when the user has explicitly opted into a single named bank via dynamicBankId=false + bankId. In that mode every session — including agent:*:main, provider 'main', and anonymous senders — should retain into the configured bank. The carve-out still requires a non-empty bankId; dynamicBankId=false alone doesn't trigger it (the bank would be unresolvable).
extractStructuredBlocks was calling stripMemoryTags + stripMetadataEnvelopes but not stripInlineRetainTags, so <retain_tags>...</retain_tags> directives survived into the retained JSON transcript on the default retainFormat=json + retainToolCalls=true path.
…format The two transcript-format assertions still expected the legacy text markers (`[role: user] ... [user:end]`), but the default retainFormat is now 'json' with Anthropic-shaped typed blocks. Parse the JSON and assert against the structured shape instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pluginConfigthroughresolveAndCacheIdentity→getIdentitySkipReasonso the skip filters know whether per-agent banking is enabled.dynamicBankGranularityincludes'agent': allowagent:*:mainsessions, allow providermain(still skipcron/heartbeat/subagent), and synthesizeagent-user:<agentId>for anonymous CLI sessions. Default behavior is unchanged otherwise.Fixes #1046
Test plan
npx vitest run src/index.test.ts(74/74 pass, including 5 new cases)./scripts/hooks/lint.sh