Skip to content

Add Playwright-backed row extraction and local LLM provider support#145

Closed
AdamEXu wants to merge 18 commits into
tinyfish-io:mainfrom
AdamEXu:exp-row
Closed

Add Playwright-backed row extraction and local LLM provider support#145
AdamEXu wants to merge 18 commits into
tinyfish-io:mainfrom
AdamEXu:exp-row

Conversation

@AdamEXu

@AdamEXu AdamEXu commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds a Playwright-backed row extraction path that can build, validate, cache, run, and repair reusable extractors through TinyFish Browser. It also carries the supporting fixes needed to make that reliable in practice: richer schema contracts, provider-selectable LLM setup, row extractor settings, better refresh/populate cancellation, and UI/backend wiring for the new configuration.

What changed

  • Added a generated Playwright row extractor runtime for populate and refresh flows, including TinyFish Browser CDP sessions, extractor validation, repair, smoke/regression checks, quality checks, and persisted per-dataset/site extractor scripts.
  • Added codification metadata to schema inference so datasets can decide whether a reusable browser extractor is disabled, candidate, required, or unknown, with source-family hints and URL templates.
  • Expanded column contracts with nullable, validation regex, normalization hints, typed values, cell sources, and stricter primary key handling.
  • Added local LLM provider selection beyond OpenRouter, including provider-specific credentials, base URLs, defaults, model compatibility filtering, extractor-builder model settings, provider logos, and setup/settings UI.
  • Added row extractor controls for concurrency and browser attempts, plus higher token/step limits where the agents need them.
  • Made stop/cancel propagation work through populate, refresh, queued subagents, dataset tools, search/fetch tools, and agent generation so the stop button cancels active and queued work instead of only marking intent.
  • Hardened scheduled refresh completion/failure with run IDs so stale refresh jobs cannot overwrite newer status.
  • Updated local dev docs/setup flow and Docker/dev Makefile wiring around the new local credential/keychain behavior.

Validation

  • git diff --check upstream/main...HEAD
  • cd backend && npm run build
  • cd frontend && npm run lint passed with warnings only: existing/new <img> warnings, React Compiler/TanStack warning, generated Convex eslint-disable warnings, and an existing analytics hook dependency warning.
  • cd frontend && npm run build

Notes for reviewers

The biggest behavioral change is that row collection can now move from one-off agent investigation to reusable browser extractors when the dataset has a stable page family. The provider/model and schema-contract changes are included because the extractor builder needs explicit model selection, validation rules, and typed normalization to avoid producing brittle scripts.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 61dfc30d-6cae-4cff-bd63-a37d66d66238

📥 Commits

Reviewing files that changed from the base of the PR and between 839831c and efce0e9.

⛔ Files ignored due to path filters (20)
  • backend/package-lock.json is excluded by !**/package-lock.json
  • frontend/convex/_generated/api.d.ts is excluded by !**/_generated/**
  • frontend/public/logos/providers/anthropic-icon.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/anthropic.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/deepinfra.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/deepseek.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/fireworks-ai.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/google-g.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/groq.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/huggingface.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/lmstudio.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/mistral-ai.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/ollama.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/openai-icon.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/openai.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/openrouter-wordmark.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/openrouter.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/qwen.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/together-ai.svg is excluded by !**/*.svg
  • frontend/public/logos/providers/xai.svg is excluded by !**/*.svg
📒 Files selected for processing (48)
  • CLAUDE.md
  • README.md
  • backend/CLAUDE.md
  • backend/package.json
  • backend/prompts/schema-inference.txt
  • backend/src/abort-registry.ts
  • backend/src/config/agent-output-tokens.ts
  • backend/src/config/llm.ts
  • backend/src/config/models.ts
  • backend/src/env.ts
  • backend/src/index.ts
  • backend/src/local-credential-types.ts
  • backend/src/local-credentials.ts
  • backend/src/mastra/agents/investigate.ts
  • backend/src/mastra/agents/populate.ts
  • backend/src/mastra/agents/refresh.ts
  • backend/src/mastra/tools/dataset-tools.ts
  • backend/src/mastra/tools/investigate-tool.ts
  • backend/src/mastra/tools/web-tools.ts
  • backend/src/mastra/workflows/infer-schema.ts
  • backend/src/mastra/workflows/populate.ts
  • backend/src/mastra/workflows/update.ts
  • backend/src/pipeline/codification.ts
  • backend/src/pipeline/populate.ts
  • backend/src/pipeline/schema-inference.ts
  • backend/src/pipeline/types.ts
  • backend/src/row-extractors/try-row-extractor.ts
  • docker-compose.dev.yml
  • frontend/Dockerfile.dev
  • frontend/app/dashboard/settings/models/page.tsx
  • frontend/app/dataset/[id]/page.tsx
  • frontend/app/dataset/new/page.tsx
  • frontend/app/setup/page.tsx
  • frontend/components/SideSheet.tsx
  • frontend/components/settings/LocalCredentialsPanel.tsx
  • frontend/components/settings/ModelSideSheet.tsx
  • frontend/components/settings/llm-providers.tsx
  • frontend/components/settings/types.ts
  • frontend/components/table/types.ts
  • frontend/convex/datasetExtractors.ts
  • frontend/convex/datasetRows.ts
  • frontend/convex/datasets.ts
  • frontend/convex/localCredentials.ts
  • frontend/convex/modelConfig.ts
  • frontend/convex/schema.ts
  • frontend/lib/backend.ts
  • frontend/lib/openrouter-oauth.ts
  • makefiles/Makefile

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Walkthrough

This change adds configurable LLM providers and provider-scoped model settings, including local setup, model discovery, schema finalization, and extractor configuration. Schema contracts now include codification profiles, richer column metadata, and array-based primary keys. Populate and refresh workflows gain queued investigations, browser extractors, structured sources, abort handling, and runtime controls. Convex persistence stores codification, extractor, provider, and cell-source data. Frontend setup, model selection, dataset creation, and source display are updated accordingly.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SetupUI
  participant Backend
  participant Provider
  User->>SetupUI: Select LLM provider and credentials
  SetupUI->>Backend: Verify and save provider configuration
  Backend->>Provider: Verify provider access
  Provider-->>Backend: Verification response
  Backend-->>SetupUI: Setup status and available models
Loading

Possibly related PRs

  • tinyfish-io/bigset#138 — Related OpenRouter-to-generic LLM provider wiring across configuration, credentials, models, and Mastra agents.

Suggested reviewers: simantak-dabhade

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch exp-row

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AdamEXu

AdamEXu commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

WIP: Still need to add sandboxing and other important features like that to make sure it's good and stuff

@AdamEXu

AdamEXu commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

have not tested the latest commit at all yet btw

@AdamEXu
AdamEXu marked this pull request as ready for review July 22, 2026 00:08
@AdamEXu AdamEXu closed this Jul 22, 2026
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