Include generated tscircuit docs in local prompt#59
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 879d867005
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| async function fetchOptionalFileContent(url: string): Promise<string> { | ||
| try { | ||
| const response = await fetch(url) |
There was a problem hiding this comment.
Add timeout to optional docs fetch
The new fetchOptionalFileContent() path only handles HTTP errors and thrown exceptions, but it still awaits fetch(url) with no timeout; if https://docs.tscircuit.com/ai.txt accepts a connection and then stalls, createLocalCircuitPrompt() will block instead of continuing with empty generated docs. This defeats the intended resilience for generated-doc outages and can hang prompt creation in degraded network conditions. Use AbortSignal.timeout(...) (or equivalent) so stalled responses fall back to "".
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in the latest commit. The optional generated-docs fetch now uses an abort timeout, and the regression test covers a stalled docs endpoint. Targeted test, full test suite, typecheck, lint, and build pass.
Summary
Changes
https://docs.tscircuit.com/ai.txtand include it increateLocalCircuitPrompt()inside a dedicated generated-docs section.OPENAI_API_KEYis not configured so deterministic tests can pass in no-secret environments.Testing
d4cf1cc: Bun Test and Type Check passed.bun test tests/prompt-templates/create-local-circuit-prompt.test.tsbun test --timeout 50000bun x tsc --noEmitbun run buildNotes
Algora
/claim #45