Skip to content

chore: add CLAUDE.md and Cursor rules for AI agent context#3

Merged
johnnichev merged 1 commit intomainfrom
chore/agent-instructions
Mar 12, 2026
Merged

chore: add CLAUDE.md and Cursor rules for AI agent context#3
johnnichev merged 1 commit intomainfrom
chore/agent-instructions

Conversation

@johnnichev
Copy link
Copy Markdown
Owner

Summary

  • CLAUDE.md at project root — comprehensive instructions for AI coding agents (Claude, Cursor, Copilot) including project structure, conventions, the full feature development checklist, release process, and 10 documented common pitfalls from past bugs
  • 5 Cursor rules in .cursor/rules/ — scoped rules for development conventions, provider implementation, agent core, testing patterns, and documentation standards

These files ensure that any AI agent entering the codebase has full context on how we build, test, document, and release features.

Test plan

  • No code changes — documentation only
  • Pre-commit hooks pass
  • Files follow .mdc format with correct frontmatter

Made with Cursor

- CLAUDE.md: comprehensive agent instructions with project overview,
  codebase structure, development commands, conventions, feature
  development checklist, release process, and common pitfalls
- .cursor/rules/selectools-development.mdc: always-apply rules for
  code conventions, testing requirements, feature completeness
  checklist, and release process
- .cursor/rules/selectools-providers.mdc: provider-specific rules
  for tool passing, streaming, message formatting, and testing
- .cursor/rules/selectools-agent-core.mdc: agent loop execution flow,
  integration points, thread safety, and defensive patterns
- .cursor/rules/selectools-testing.mdc: test organization, mock/
  recording provider patterns, regression test conventions
- .cursor/rules/selectools-docs.mdc: MkDocs site structure, link
  rules, hardcoded count locations, and documentation style

Made-with: Cursor
@johnnichev johnnichev merged commit c8c16b7 into main Mar 12, 2026
@johnnichev johnnichev deleted the chore/agent-instructions branch March 12, 2026 23:51
johnnichev added a commit that referenced this pull request Mar 24, 2026
Security:
- Path traversal in JsonFileSessionStore — validate session_id (#9)
- Unicode homoglyph bypass in injection screening — NFKD + zero-width
  strip + homoglyph map (#13)

Data integrity:
- FileKnowledgeStore._save_all() atomic write via tmp + os.replace (#10)
- JsonFileSessionStore.save() atomic write (#31)

Agent core:
- astream() uses self._effective_model (was self.config.model) (#1)
- Sync _check_policy rejects async confirm_action with clear error (#2)
- Sync _streaming_call isinstance(chunk, str) guard (#18)

Providers:
- FallbackProvider stream()/astream() record success after consumption,
  not before — circuit breaker now works for streaming (#3)
- Gemini response.text ValueError catch for tool-call-only responses (#4)

Tools:
- aexecute() uses run_in_executor(None) shared executor (#5)
- execute() awaits coroutines from async tools via asyncio.run (#6)

RAG:
- Hybrid search O(n²) → O(1) via text_to_key dict lookup (#7)
- SQLiteVectorStore thread safety + WAL mode (#8)

Evals:
- OutputEvaluator catches re.error on invalid regex (#11)
- JsonValidityEvaluator respects expect_json=False (#12)

16 new regression tests. Full suite: 2000 passed.
johnnichev added a commit that referenced this pull request Apr 12, 2026
…etection

Source: LiteLLM #13515. Azure OpenAI deployments use user-chosen names
(e.g., "prod-chat", "my-reasoning"), NOT the underlying model's family
prefix. AzureOpenAIProvider inherited _get_token_key from OpenAIProvider,
which calls `model.startswith("gpt-5")` etc. with the deployment name. An
Azure deployment of gpt-5-mini under name "prod-chat" therefore received
`max_tokens` instead of `max_completion_tokens` and hit
`BadRequestError: Unsupported parameter: 'max_tokens'`. Azure variant of
round-1 pitfall #3 — the direct OpenAI path was fixed but the Azure
subclass bypassed family detection entirely.

Fix: added `model_family: str | None = None` kwarg to
AzureOpenAIProvider.__init__. When set, overrides the deployment-name-based
family detection so users can explicitly tell selectools what family their
deployment is. Backward compatible: model_family=None falls back to the
original deployment-name prefix matching.

Usage:

    AzureOpenAIProvider(
        azure_deployment="prod-chat",  # user-chosen deployment name
        model_family="gpt-5",          # underlying family
    )

3 regression tests in tests/agent/test_regression.py.
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