Skip to content

Centralize AI prompts into instructions.ts#84

Open
Dhereal1 wants to merge 4 commits intoHyperlinksSpace:mainfrom
Dhereal1:isolate-ai-instructions
Open

Centralize AI prompts into instructions.ts#84
Dhereal1 wants to merge 4 commits intoHyperlinksSpace:mainfrom
Dhereal1:isolate-ai-instructions

Conversation

@Dhereal1
Copy link
Copy Markdown
Contributor

@Dhereal1 Dhereal1 commented Apr 2, 2026

  • Centralizes AI instruction/prompt strings into dedicated instructions.ts modules\n- Adds versioned /start message (via BOT_VERSION) + tests\n- Adds CI workflows for app bot and python bot tests

…ntroller

- Introduce thread-scoped AbortController map

- Abort previous generation when new message arrives for same thread

- Propagate abort signal to AI streaming layer

- Stop Telegram edit loop immediately on abort

- Preserve existing HTML + chunking behavior

Implements G1 (hard cancellation). Multi-thread concurrency intentionally deferred.
- fix incorrect abort logic (max > current update_id)

- ensure streams stop immediately on cancel

- prevent stale generations from sending updates

- add generation-based cancellation guard

- make streaming non-blocking (no awaited edits)

- improve logging with update_id for tracing
Copy link
Copy Markdown
Member

@staindart staindart left a comment

Choose a reason for hiding this comment

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

Please delete changes in bot/bot.py and check for errors. Now working on test

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