Skip to content

Include generated ai.txt docs in createLocalCircuitPrompt#63

Open
JYZ-LESLIE wants to merge 2 commits into
tscircuit:mainfrom
JYZ-LESLIE:codex/add-generated-ai-docs-prompt
Open

Include generated ai.txt docs in createLocalCircuitPrompt#63
JYZ-LESLIE wants to merge 2 commits into
tscircuit:mainfrom
JYZ-LESLIE:codex/add-generated-ai-docs-prompt

Conversation

@JYZ-LESLIE
Copy link
Copy Markdown

Summary

  • fetch https://docs.tscircuit.com/ai.txt inside createLocalCircuitPrompt
  • prepend the generated docs block into the system prompt when available
  • make remote-doc fetch failures non-fatal so prompt generation still succeeds

This directly wires the new generated docs into prompt construction while keeping prompt creation resilient.

/claim #45

@JYZ-LESLIE
Copy link
Copy Markdown
Author

Follow-up update: I pushed commit 21bbf81 to address the failing test check and make the suite deterministic without requiring a live OpenAI key.

What changed:

  • TscircuitCoder now correctly forwards openaiClient into runAiWithErrorCorrection.
  • Recursive retry path in runAiWithErrorCorrection now preserves openaiClient.
  • generateRandomPrompts now accepts an optional injected client (default remains the existing OpenAI client).
  • Updated tests to use deterministic mocked clients:
    • tests/tscircuitCoder.test.ts
    • tests/utils/generate-random-prompts.test.ts

Validation run locally on this branch:

  • PATH="/tmp/bun-bin/bun-darwin-aarch64:$PATH" bun test --timeout 50000
  • Result: 13 pass, 0 fail.

Please re-run CI and merge when convenient. Thanks!

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