Skip to content

feat: add cortex-code transcript provider#20

Open
jamescha-earley wants to merge 1 commit intovtemian:mainfrom
jamescha-earley:feat/cortex-code-provider
Open

feat: add cortex-code transcript provider#20
jamescha-earley wants to merge 1 commit intovtemian:mainfrom
jamescha-earley:feat/cortex-code-provider

Conversation

@jamescha-earley
Copy link
Copy Markdown

@jamescha-earley jamescha-earley commented Mar 20, 2026

Summary

  • Adds a new cortexCode transcript provider that discovers and parses Snowflake Cortex Code conversation transcripts from ~/.snowflake/cortex/conversations/*.json
  • Scopes discovery to workspace via working_directory matching, detects running/idle/completed status from last_updated recency and active tool calls
  • Extracts connection name, message count, tool call count, and session type as metadata; registers as a default provider alongside cursor, claude-code, codex, and opencode

Test plan

  • 41 new tests across 4 test files (schemas, discovery, transcripts, provider integration)
  • npm run check passes (biome + typecheck + 262 tests across 36 files)
  • Build succeeds with ESM, CJS, and DTS outputs including new providers/cortex-code entry point
  • Tested locally against 297 real Cortex Code conversation files — correct discovery, parsing, metadata extraction, and status detection

Checklist

  • Tests added
  • npm run check passes
  • Docs updated (README.md — providers list, entry points, provider count)
  • CHANGELOG updated (Unreleased section)

.... Generated with Cortex Code


Summary by cubic

Adds a new cortexCode transcript provider that discovers and parses Snowflake Cortex Code session JSONs and normalizes them into agent snapshots. It’s included in the default provider set for observers.

  • New Features

    • Discovers sessions from ~/.snowflake/cortex/conversations/*.json, scoped by working_directory.
    • Detects running/idle/completed using last_updated recency and active tool calls.
    • Extracts metadata: connection name, message count, tool call count, session type; builds task summary from first user prompt.
    • Caches file headers by mtime to skip unchanged files; JSON file watch with 150ms debounce.
    • Public entry: @agentprobe/core/providers/cortex-code; registered as a default provider; 41 tests added.
  • Migration

    • No changes required—createObserver() now includes cortexCode() by default.
    • To customize, import cortexCode from @agentprobe/core/providers/cortex-code and pass options like cortexHomePath, maxFiles, or disable watch.

Written for commit c645adf. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 18 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/providers/cortex-code/transcripts.ts">

<violation number="1" location="src/providers/cortex-code/transcripts.ts:237">
P2: Hardcoded source string diverges from the canonical CORTEX_CODE_SOURCE_KIND, risking identifier drift and downstream mismatches.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Add a new provider that discovers and parses Snowflake Cortex Code
conversation transcripts from ~/.snowflake/cortex/conversations/*.json.

- Scopes discovery to workspace via working_directory matching
- Detects running/idle/completed status from last_updated recency
- Extracts connection name, message count, tool call count, session type
- Caches file headers by mtime to skip unchanged files
- Registers as default provider alongside cursor, claude-code, codex, opencode
- 41 new tests across schemas, discovery, transcripts, and provider integration

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
@jamescha-earley jamescha-earley force-pushed the feat/cortex-code-provider branch from 12add4c to c645adf Compare March 20, 2026 22:33
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