Skip to content

Custom AI keys: keep the prompt ending, empty line before appended results - #725

Merged
LeanBitLab merged 1 commit into
LeanBitLab:mainfrom
4di-hello:fix/ai-key-result-spacing
Oct 25, 2026
Merged

LeanBitLab merged 1 commit into
LeanBitLab:mainfrom
4di-hello:fix/ai-key-result-spacing

Conversation

@4di-hello

Copy link
Copy Markdown
Contributor

Two small fixes for the custom AI keys:

  • Keyword instructions before the prompt. The instructions of keywords like #editor were added after the custom prompt. A prompt that ends with an answer start ("Answer:") or embeds the text with {text} then ended with the English instruction, and small local models answered badly (for example by repeating the example from the prompt). The instructions now go before the prompt.
  • Empty line before appended results. With #append the result was glued to the last word of the text ("…Best regards, SamSure, …"). It now starts in a new paragraph.

Tested on a Xiaomi with Qwen3-4B (offline). New unit test CustomAIKeyTextTest, InputLogicTest still passes.

…sults

- keyword instructions (e.g. #editor) go before the custom prompt instead of
  after it, so prompts that end with "Answer:" or embed {text} keep working
- #append separates the result from the text with an empty line instead of
  gluing it to the last word

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VuiaMhLXwhErf9shhrr1uD
4di-hello added a commit to 4di-hello/LeanType that referenced this pull request Oct 24, 2026
@LeanBitLab
LeanBitLab merged commit 99b99a0 into LeanBitLab:main Oct 25, 2026
1 check passed
4di-hello added a commit to 4di-hello/LeanType that referenced this pull request Oct 27, 2026
4di-hello added a commit to 4di-hello/LeanType that referenced this pull request Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants