Skip to content

fix: make agent state ownership upsert atomic#215

Open
yibeichan wants to merge 1 commit into
mainfrom
codex/fix-set-agent-state-toctou
Open

fix: make agent state ownership upsert atomic#215
yibeichan wants to merge 1 commit into
mainfrom
codex/fix-set-agent-state-toctou

Conversation

@yibeichan

Copy link
Copy Markdown
Owner

Summary

  • replace the split owner-check/upsert in setAgentState with one conditional atomic upsert
  • preserve OWNERSHIP_ERROR behavior when another owner wins the key
  • add a trigger-based regression that simulates an interleaving owner insert

Closes #212.

Tests

  • cd mcp-server && npm test -- --testPathPatterns=memory.test.ts
  • cd mcp-server && npm test
  • cd mcp-server && npm run build

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.

bug: setAgentState ownership check is not atomic — TOCTOU race allows silent value overwrite under concurrent writes

1 participant