Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #383 by making synchronous GPTel helper calls fail faster and degrade gracefully in the places where GPTel is only used as an enhancement.
Details
ai-code-call-gptel-syncnow has a configurable 10 second default timeout throughai-code-gptel-sync-timeout-seconds, plus per-call:timeoutand:fallbackoptions. Calls without a fallback keep the previous error behavior, while callers that can safely continue now provide explicit fallback values.The fallbacks are tailored by use case: prompt headlines skip the generated text, filename generation uses deterministic local cleanup, shell command generation returns an empty command instead of risking a bad command, and GPTel classifiers fall back to
UNKNOWNor keyword-based classification.Verification
emacs -Q -batch -L . -l test/test_00-bootstrap.el -l ert --eval "(mapc #'load-file (file-expand-wildcards \"test/test_*.el\"))" -f ert-run-tests-batch-and-exitemacs -Q -batch -L . -l test/test_00-bootstrap.el -f batch-byte-compile ai-code-prompt-mode.el ai-code-file.el ai-code-harness.el ai-code-behaviors.el ai-code-discussion.elcheckdoc-filefor touched Emacs Lisp files