feat: conversation fabric types, P0 CDP spike, and Grok provider discovery - #9
Open
MrJ55 wants to merge 6 commits into
Open
feat: conversation fabric types, P0 CDP spike, and Grok provider discovery#9MrJ55 wants to merge 6 commits into
MrJ55 wants to merge 6 commits into
Conversation
getAgentStatus truncated long answers to their final fragment and could get stuck reporting WORKING after the answer finished streaming. Fixes: - Join ALL [class*="prose"] blocks with containment dedup instead of taking only the last element - long answers are returned in full, without duplicated nested content. - Raise the response cap from 8000 to 30000 chars. - Completion detection: "Ask a follow-up" + prose wins over the working-text heuristic, so answers whose text contains words like "Working"/"Searching"/"Analyzing" no longer leave comet_poll stuck on WORKING. - Harden getAgentStatus against undefined CDP evaluate results (dead tab, navigate race, closed browser) so callers never crash on status.toUpperCase(). Verified end-to-end against live Perplexity threads (search mode) through the MCP gateway: comet_poll returns the complete, deduplicated answer.
…indings, Grok discovery runbook
…ntries for Perplexity and Grok
This was referenced Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the conversation-fabric type contracts, the P0 CDP-concurrency findings, and the P2 Grok provider discovery to comet-mcp — the first concrete steps toward the multi-provider backbone described in
docs/build-plan.mdand ADR 0001. No existing behavior changes; all new files.What's included
P1 — Conversation fabric type contracts (ADR 0002,
src/types/)conversation.ts:ConversationEnvelope(distinct idempotency key / correlation ID),DeliveryReceiptwith 7 statuses (queued|sent|accepted|completed|blocked|timed_out|unknown—unknownis never silently resent, per ADR 0001 §5), append-onlyConversationEventlog,Provenance(attribution is an audit control, explicitly not a safety claim), content persistence modes (full|redacted|none), conservative relay defaults (approval-required, unapproved).provider.ts: normalizedProviderStateunion,PollResult(truthfulhasStopButton; extraction-provenance flags preserve the Bug WSL Support: Add COMET_HOST and COMET_PORT environment variables #1/Bug Stop closing user's existing browser tabs on connect #2 fix lineage),TabSession(P3 reconnect/dedup anchors typed now),HealthReport(per-control hook-resolution source for P8 drift detection),ChatDriveradapter contract (open/ask/poll/stop/reset/health).P1/P2 — Provider registry entries (
src/providers/)grok.ts: HIGH-confidence entry from live discovery (selectors, heuristics, state machine). Documents the verified finding that Grok's Fast model never renders a stop button — streaming state must use the "Working for Xs" indicator.perplexity.ts: MEDIUM-confidence entry extracted from the existingcomet-ai.tscontract + session-handoff verification (the P1 refactor seed).P0 — CDP concurrency spike (
test/integration/cdp-concurrency-spike.mjs,docs/p0-cdp-concurrency-findings.md)max_concurrent_tabs: 5, configurable.P2 — Grok discovery workflow (
test/integration/grok-discover.mjs,test/fixtures/grok/,docs/runbooks/grok-provider-discovery.md)--diffmode that re-runs discovery and diffs the provider entry against the previous run (workflow step 9).Docs
docs/build-plan.md, ADR 0001 + 0002, design syntheses (00–02), reference docs, runbook.Notes for reviewers
tsc --noEmitpasses with both provider entries consuming the shared types.ChatDriverimplementations, and the Perplexity refactor are next (P1 runtime work).test/integration/out/run artifacts are gitignored as regenerable.Related
docs/build-plan.md