Skip to content

Validate company slugs in TheirStack API and reject invalid requests#5

Draft
Copilot wants to merge 2 commits intocodex/integrate-ashby-job-ingestion-strategyfrom
copilot/sub-pr-2-another-one
Draft

Validate company slugs in TheirStack API and reject invalid requests#5
Copilot wants to merge 2 commits intocodex/integrate-ashby-job-ingestion-strategyfrom
copilot/sub-pr-2-another-one

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 11, 2026

Unknown company slugs were silently dropped by resolveCompanies(), causing successful-but-empty runs that were hard to debug.

Changes:

  • Export ASHBY_COMPANY_SLUGS from theirstack-fetcher.ts for validation
  • Add slug validation in pipeline route before execution:
    • Return 400 with invalid slug list when no valid slugs provided
    • Log warning and proceed when mix of valid/invalid slugs provided
  • Validation only applies when source=theirstack and companies parameter is non-empty

Behavior:

# All invalid → 400 error
POST /api/pipeline/step1?source=theirstack&companies=badco,invalid
{
  "error": "No valid company slugs provided",
  "invalidSlugs": ["badco", "invalid"],
  "hint": "Use valid Ashby company slugs. See ASHBY_COMPANY_SLUGS for supported companies."
}

# Mixed valid/invalid → warn and proceed with valid
POST /api/pipeline/step1?source=theirstack&companies=openai,badco
# Logs: "Invalid company slugs provided: badco"
# Proceeds with: openai

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Mayank-glitch-cpu <85422185+Mayank-glitch-cpu@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on Ashby slug pool expansion and API filters changes Validate company slugs in TheirStack API and reject invalid requests Feb 11, 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.

2 participants