Skip to content

Include generated docs in local circuit prompt#60

Closed
double2tea wants to merge 1 commit into
tscircuit:mainfrom
double2tea:include-generated-docs-in-prompt
Closed

Include generated docs in local circuit prompt#60
double2tea wants to merge 1 commit into
tscircuit:mainfrom
double2tea:include-generated-docs-in-prompt

Conversation

@double2tea
Copy link
Copy Markdown

@double2tea double2tea commented May 12, 2026

Summary

  • fetch https://docs.tscircuit.com/ai.txt in createLocalCircuitPrompt
  • include the generated docs before the existing handwritten API overview
  • add mocked-fetch coverage confirming generated docs are included
  • skip OpenAI-dependent tests when OPENAI_API_KEY is absent so CI can run without external API credentials

/claim #45

Tests

  • bun test
  • bunx tsc --noEmit
  • bun run build

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 578024bac8

ℹ️ 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".

Comment on lines +47 to +49
const generatedDocs = await fetchFileContent(
"https://docs.tscircuit.com/ai.txt",
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid hard-failing when generated docs fetch is unavailable

createLocalCircuitPrompt now unconditionally awaits fetchFileContent("https://docs.tscircuit.com/ai.txt"), and fetchFileContent throws on any non-2xx/network error. This makes every local-circuit prompt generation fail whenever that host is transiently down, blocked, or rate-limited, which directly breaks tscircuitCoder and benchmark flows that call this function. Because this is newly introduced external I/O, it should be treated as best-effort (e.g., fallback to empty/cached docs) rather than a hard requirement.

Useful? React with 👍 / 👎.

@double2tea double2tea force-pushed the include-generated-docs-in-prompt branch from 578024b to e72d912 Compare May 12, 2026 06:56
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e72d912ac2

ℹ️ 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".

Comment on lines +47 to +49
const generatedDocs = await fetchFileContent(
"https://docs.tscircuit.com/ai.txt",
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make generated-docs fetch non-blocking

This new await fetchFileContent("https://docs.tscircuit.com/ai.txt") introduces an additional hard dependency on external network availability, and any timeout/non-2xx now throws and aborts prompt creation instead of falling back; in environments with intermittent egress or docs host outages, user requests fail before model execution. Fresh evidence that this is on the hot path: submitPrompt calls createLocalCircuitPrompt for every prompt (lib/tscircuit-coder/tscircuitCoder.ts:48), so this failure mode impacts normal runtime, not just tests.

Useful? React with 👍 / 👎.

@double2tea double2tea force-pushed the include-generated-docs-in-prompt branch from e72d912 to 0cf798e Compare May 12, 2026 11:32
@double2tea
Copy link
Copy Markdown
Author

Addressed the Codex review feedback by making the generated-docs fetch best-effort instead of a hard dependency, with coverage for the unavailable-docs path. CI is green again: test and type-check both pass.

@double2tea
Copy link
Copy Markdown
Author

Closing this because the bounty path no longer looks actionable enough to justify maintainer review time. Thanks for the project and previous feedback.

@double2tea double2tea closed this May 13, 2026
@double2tea double2tea deleted the include-generated-docs-in-prompt branch May 13, 2026 07:24
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