Skip to content

Fix concurrent session tag updates targeting the wrong tag - #65

Open
blast-hardcheese wants to merge 1 commit into
mainfrom
fork-session-bugfix
Open

blast-hardcheese wants to merge 1 commit into
mainfrom
fork-session-bugfix

Conversation

@blast-hardcheese

Copy link
Copy Markdown
Collaborator

Summary

  • Require an explicit tag name for MCP and CLI update, segment, pause, and end actions. Concurrent sessions in one project can no longer select each other's tags through the most recently updated active tag.
  • Update agent guidance and CLI examples to pass the tag name.
  • Add regression coverage for unnamed actions with one and two active tags, plus explicit-name end with a more recently updated peer.

Verification

  • wander-serialized-test -- env PYTHONPATH=/Users/dstewart/Projects/kindex/fork-session-bugfix/src /Users/dstewart/Projects/kindex/main/.venv/bin/python -m pytest tests/test_mcp.py tests/test_sessions.py -q — 150 passed.
  • git diff --check — clean.

The full test suite will run in CI.

@adaptcom adaptcom Bot 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.

Confidence Score: 4/5

Summary

Requires explicit tags to prevent cross-session mutations; 2,913 tests pass. Remaining risks are misleading CLI exit codes and stale agent instructions.

Important Files Changed

File Overview
README.md Adds explicit tag names to lifecycle examples
docs/mcp-agent-guide.md Documents mandatory tag names
src/kindex/cli.py Rejects unnamed mutations but exits successfully
src/kindex/mcp_server.py Rejects missing or blank tag names
tests/test_mcp.py Covers unnamed mutation refusal and explicit-name isolation
tests/test_sessions.py Tests unnamed CLI rejection without asserting failure exit status

Findings

  • Update CLAUDE.md:81 and AGENTS.md:81 to include tag names; their update, segment, and end examples now always fail.

↻ Re-run review · View in Adapt

Comment thread src/kindex/cli.py
if action in {"update", "segment", "pause", "end"} and not tag_name:
print(f"Error: kin tag {action} requires an explicit tag name.", file=sys.stderr)
store.close()
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Rejected unnamed commands exit 0, so scripts treat lifecycle no-ops as successful; exit nonzero and assert failure status in the new tests.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant