Skip to content

Include generated docs in local circuit prompt#87

Open
michaelapollopimentel-svg wants to merge 3 commits into
tscircuit:mainfrom
michaelapollopimentel-svg:codex/generated-docs-prompt-timeout-45
Open

Include generated docs in local circuit prompt#87
michaelapollopimentel-svg wants to merge 3 commits into
tscircuit:mainfrom
michaelapollopimentel-svg:codex/generated-docs-prompt-timeout-45

Conversation

@michaelapollopimentel-svg

@michaelapollopimentel-svg michaelapollopimentel-svg commented May 26, 2026

Copy link
Copy Markdown

Summary

  • Load generated tscircuit docs from https://docs.tscircuit.com/llms.txt into createLocalCircuitPrompt as optional context, with https://docs.tscircuit.com/ai.txt as a legacy fallback.
  • Include both generated props references from tscircuit/props: COMPONENT_TYPES.md and PROPS_OVERVIEW.md.
  • Cache successful generated-docs fetches, retry after failures, and abort optional docs fetches after a short timeout so prompt creation does not hang on external docs endpoints.
  • Add mocked-fetch coverage for generated-doc inclusion, primary-to-legacy fallback, caching, retry behavior, and generated props docs inclusion.
  • Make OpenAI-backed tests opt-in via RUN_OPENAI_TESTS=1 so default CI does not require API credentials.

/claim #45

Validation

  • git diff --check
  • node --check lib/prompt-templates/create-local-circuit-prompt.ts
  • node --check tests/create-local-circuit-prompt.test.ts
  • node --check tests/tscircuitCoder.test.ts
  • node --check tests/utils/generate-random-prompts.test.ts
  • GitHub Actions: test success
  • GitHub Actions: type-check success

Bun is not installed in this local environment, so I am relying on GitHub Actions for the full Bun test and type-check matrix.

@michaelapollopimentel-svg

Copy link
Copy Markdown
Author

Friendly follow-up on #45: this PR has been open and green since May 26 with both test and type-check passing. It includes /claim #45 and covers generated-doc inclusion, fallback, caching, retry, and timeout behavior. If there is anything specific you want changed before review, I can adjust it.

@michaelapollopimentel-svg

Copy link
Copy Markdown
Author

Updated this PR to include the generated PROPS_OVERVIEW.md from tscircuit/props alongside COMPONENT_TYPES.md, so the prompt now consumes both generated props docs plus the optional docs-site ai.txt context. Local validation rerun:

  • git diff --check
  • node --check lib/prompt-templates/create-local-circuit-prompt.ts
  • node --check tests/create-local-circuit-prompt.test.ts
  • node --check tests/tscircuitCoder.test.ts
  • node --check tests/utils/generate-random-prompts.test.ts

@michaelapollopimentel-svg

Copy link
Copy Markdown
Author

Updated this PR again to use https://docs.tscircuit.com/llms.txt as the primary generated docs source, with https://docs.tscircuit.com/ai.txt retained as a legacy fallback. I verified both URLs currently serve the same generated docs payload, but llms.txt is the standard docs endpoint and this keeps prompt generation resilient if either endpoint changes.

Local validation rerun:

  • git diff --check
  • node --check lib/prompt-templates/create-local-circuit-prompt.ts
  • node --check tests/create-local-circuit-prompt.test.ts

bun is still not installed locally, so full Bun tests/type-check are left to GitHub Actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant