Skip to content

fix(plugins): rename ACONTEXT_USER_ID → ACONTEXT_USER_IDENTIFIER & remove unnecessary flush calls#454

Merged
GenerQAQ merged 1 commit intodevfrom
fix/user-identifier-and-flush
Mar 18, 2026
Merged

fix(plugins): rename ACONTEXT_USER_ID → ACONTEXT_USER_IDENTIFIER & remove unnecessary flush calls#454
GenerQAQ merged 1 commit intodevfrom
fix/user-identifier-and-flush

Conversation

@GenerQAQ
Copy link
Copy Markdown
Contributor

Why we need this PR?

Two issues in the claude-code and openclaw plugins:

  1. ACONTEXT_USER_ID is misleading — it's actually an identifier/tag for session scoping, not a login user ID. Priority was also inverted (auth.json winning over explicit env/config).
  2. flush() is blocking and called in auto-learn paths unnecessarily. The server processes learning asynchronously via RabbitMQ workers, so flush is only needed for explicit user-triggered tools.

Describe your solution

Issue 1: Rename & fix priority

  • Claude Code: New env var ACONTEXT_USER_IDENTIFIER (with ACONTEXT_USER_ID as legacy fallback). Priority: env var > auth.json > "claude_code".
  • OpenClaw: New config key userIdentifier (with userId as legacy fallback). Priority: plugin config > auth.json > "openclaw".
  • Default identifiers are now platform-specific (claude_code / openclaw) instead of generic "default".

Issue 2: Remove unnecessary flush calls

  • Removed flush() from auto-learn (post-tool-use hook, agent_end), stop handler, and compaction/reset paths.
  • Kept flush() only in explicit learn_now MCP tools where the user expects synchronous results.
  • Renamed flushAndLearnIfActivelearnIfActive in openclaw.

Implementation Tasks

  • Rename env var / config key with legacy fallback in both plugins
  • Fix identifier resolution priority in both plugins
  • Change default identifiers to platform-specific values
  • Remove flush() from 4 automatic paths (2 in claude-code, 2 in openclaw)
  • Update tests (3 new tests in claude-code, 2 updated in openclaw)
  • Update docs (README, claude-code.mdx, openclaw.mdx, SKILL.md)
  • Rebuild claude-code bundles

Impact Areas

  • Documentation
  • Other: Claude Code Plugin, OpenClaw Plugin

Checklist

  • Open your pull request against the dev branch.
  • All tests pass in available continuous integration systems (e.g., GitHub Actions).
  • Tests are added or modified as needed to cover code changes.

… remove unnecessary flush calls

- Rename env var to ACONTEXT_USER_IDENTIFIER (keep ACONTEXT_USER_ID as legacy fallback)
- Fix identifier priority: explicit config > auth.json > platform default
- Default identifiers are now platform-specific: "claude_code" and "openclaw"
- OpenClaw accepts userIdentifier config key (userId as legacy fallback)
- Remove blocking flush() from auto-learn, stop handler, and compaction/reset paths
- Keep flush() only in explicit learn_now MCP tools
- Update docs and SKILL.md for both plugins

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@GenerQAQ GenerQAQ requested a review from a team as a code owner March 18, 2026 14:23
@GenerQAQ
Copy link
Copy Markdown
Contributor Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@GenerQAQ GenerQAQ merged commit 5b03a14 into dev Mar 18, 2026
6 checks passed
@GenerQAQ GenerQAQ deleted the fix/user-identifier-and-flush branch March 18, 2026 15:39
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