Skip to content

feat: v1.5.0 - Context-Aware Stack Detection#37

Merged
victormartingil merged 1 commit intomainfrom
feat/context-aware-stack-detection
Feb 11, 2026
Merged

feat: v1.5.0 - Context-Aware Stack Detection#37
victormartingil merged 1 commit intomainfrom
feat/context-aware-stack-detection

Conversation

@victormartingil
Copy link
Member

Summary

This PR introduces automatic project technology stack detection at REPL startup, preventing COCO from suggesting incompatible technologies.

Changes

Added

  • Stack detector service (src/cli/repl/context/stack-detector.ts)

    • Detects language/runtime: Node.js, Java, Python, Go, Rust
    • Extracts dependencies from package.json, pom.xml, build.gradle, pyproject.toml, Cargo.toml, go.mod
    • Infers frameworks (Spring Boot, React, FastAPI, etc.) from dependencies
    • Detects package manager (npm, pnpm, yarn, maven, gradle, cargo, pip, go)
    • Detects build tools and testing frameworks
  • CommandHeartbeat utility (src/tools/utils/heartbeat.ts)

    • Infrastructure for monitoring long-running commands
    • Foundation for future streaming feature (v1.6.0)
    • Comprehensive test coverage
  • ReplSession type extension

    • Added projectContext field to store detected stack information

Changed

  • REPL startup now detects and stores project stack context
  • System prompt enriched with technology stack information
  • Stack info formatted and injected into LLM context

Fixed

  • Major UX improvement: Prevents COCO from suggesting Node.js packages in Java projects (and vice versa)

Testing

  • All tests pass (4694 tests)
  • TypeScript type checking passes
  • Linting and formatting clean
  • New tests for stack detector and heartbeat utility

Impact

This significantly improves the user experience by ensuring COCO's suggestions are always compatible with the project's technology stack. No more suggestions to npm install in a Java project!

🤖 Generated with Claude Code

Add auto-detection of project technology stack at REPL startup to prevent
COCO from suggesting incompatible technologies.

Features:
- Detect language/runtime (Node.js, Java, Python, Go, Rust)
- Extract dependencies from package.json, pom.xml, build.gradle, etc.
- Infer frameworks (Spring Boot, React, FastAPI) from dependencies
- Detect package manager, build tools, and testing frameworks
- Enrich LLM system prompt with stack context
- Prevent mismatched technology suggestions

Added:
- Stack detector service (src/cli/repl/context/stack-detector.ts)
- CommandHeartbeat utility for future streaming feature
- projectContext field in ReplSession type
- Stack info in system prompt formatting

Changed:
- REPL startup now detects and stores stack context
- System prompt enriched with technology stack information

This prevents COCO from suggesting npm packages in Java projects and
vice versa, significantly improving user experience.
@victormartingil victormartingil merged commit ceade12 into main Feb 11, 2026
5 checks passed
@victormartingil victormartingil deleted the feat/context-aware-stack-detection branch February 11, 2026 11:48
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