Alishahryar1
b05d0d2703
new linter rules and fixes
2026-02-18 04:13:41 -08:00
Alishahryar1
7300156925
Add status message handling for voice note processing
...
- Introduced a new optional field `status_message_id` in the IncomingMessage model to track the status of voice note processing.
- Updated the Telegram and Discord platforms to utilize the `status_message_id` for editing status messages instead of sending new ones.
- Modified tests to assert the correct status message ID is used during voice note handling.
- Changed status message text from "Processing voice note..." to "Transcribing voice note..." for clarity.
2026-02-16 20:48:47 -08:00
Cursor Agent
4b4f87515d
Phase 7: Directory restructuring (messaging/ and tests/)
...
- Create messaging/platforms/ (base, discord, telegram, factory)
- Create messaging/rendering/ (discord_markdown, telegram_markdown)
- Create messaging/trees/ (data, repository, processor, queue_manager)
- Organize tests/ into api/, providers/, messaging/, cli/, config/
- Add backward-compatible re-exports at old locations
- Update handler.py and test_messaging_factory.py imports
- Fix Telegram type hints for TELEGRAM_AVAILABLE=False case
- Fix Python 3 except syntax in discord_markdown
Co-authored-by: Ali Khokhar <alishahryar2@gmail.com >
2026-02-17 02:25:42 +00:00
Cursor Agent
794e64bba9
Fix ruff format for handler.py and session.py
...
Co-authored-by: Ali Khokhar <alishahryar2@gmail.com >
2026-02-17 02:03:04 +00:00
Cursor Agent
bfc781e0ed
Phase 4-6: Dead code removal, performance, minor fixes
...
Phase 4:
- Remove legacy SessionRecord, _sessions, _msg_to_session from SessionStore
- Fix hardcoded provider in root endpoint (use settings.provider_type)
- Update session store tests
Phase 5:
- Use list-based string accumulation in ThinkingSegment, TextSegment, ToolCallSegment
- Cache MAX_MESSAGE_LOG_ENTRIES_PER_CHAT at SessionStore init
- Use iterative DFS in MessageTree.get_descendants
Phase 6:
- Add comment for abstract async generator workaround in BaseProvider
- Rename TELEGRAM_EDIT log tags to PLATFORM_EDIT in handler
Co-authored-by: Ali Khokhar <alishahryar2@gmail.com >
2026-02-17 02:01:01 +00:00
Alishahryar1
6abcdb4017
Add clear command functionality to message handler
...
- Implemented handling of the `/clear` command to clear specific branches or entire trees based on message replies.
- Added tests for various scenarios of the clear command, including clearing branches, handling unknown replies, and clearing entire trees.
- Enhanced `TreeQueueManager` with methods to cancel branches and remove subtrees, ensuring proper state management in the session store.
- Updated `SessionStore` and `TreeRepository` to support removal of node mappings and trees, improving data integrity during clear operations.
2026-02-16 16:23:26 -08:00
Alishahryar1
6511542bfe
Implement Discord bot support and update README for messaging platform changes
2026-02-16 00:08:09 -08:00
Alishahryar1
539854fe7b
Refactor done using GLM-5
2026-02-15 21:58:03 -08:00
Alishahryar1
7dfcad2a4c
Enhance logging and error handling across multiple modules
...
- Added request ID context to logging in FastAPI routes and NVIDIA NIM provider.
- Improved logging format to include context variables for better traceability.
- Updated message handling in Telegram and Claude handlers to log message previews.
- Enhanced error logging in NVIDIA NIM provider with request ID for easier debugging.
- Added logging for tree repository actions to track tree and node registrations.
2026-02-15 02:01:57 -08:00
Alishahryar1
7259b1def8
Optimized code in hot paths with z-ai/glm5
2026-02-14 19:59:46 -08:00
Alishahryar1
710e532888
lint
2026-02-14 19:17:51 -08:00
Alishahryar1
9be9943401
Improved test coverage
2026-02-14 19:17:19 -08:00
Alishahryar1
ba344f26c9
Revamped logging
2026-02-14 18:55:33 -08:00
Alishahryar1
64e5b10612
Refactor done by z-ai/glm5
2026-02-14 18:47:26 -08:00
Alishahryar1
25b9d9d1e4
Added ruff and ty dependencies and lint
2026-02-14 18:00:21 -08:00
Cursor Agent
f27c2caf18
Phase 3: Split _process_node into smaller methods
...
- _create_transcript_and_render_ctx(): returns transcript + RenderCtx
- _handle_session_info_event(): handles session_info, returns (captured, temp)
- _process_parsed_event(): processes single parsed event, returns (last_status, had_transcript_events)
- _process_node: now ~90 lines, delegates to helpers
Improves readability and testability.
Co-authored-by: Ali Khokhar <alishahryar2@gmail.com >
2026-02-15 01:36:12 +00:00
Cursor Agent
7496f67ae0
Phase 2: Extract markdown utilities to messaging/telegram_markdown.py
...
- Create messaging/telegram_markdown.py with all MarkdownV2 helpers
- Move escape_md_v2, escape_md_v2_code, escape_md_v2_link_url, mdv2_bold,
mdv2_code_inline, format_status, render_markdown_to_mdv2
- Update handler.py to import from telegram_markdown (~300 lines removed)
- Update telegram.py to use shared escape_md_v2 (remove duplicate)
- Update tests to import from messaging.telegram_markdown
Co-authored-by: Ali Khokhar <alishahryar2@gmail.com >
2026-02-15 01:34:27 +00:00
Alishahryar1
4247f411b0
Fixed truncation errors in telegram and added subagent display
2026-02-14 02:41:48 -08:00
Alishahryar1
b95f2ef9c4
Revamped telegram result display
2026-02-14 02:14:36 -08:00
Alishahryar1
fabca59f5c
lint
2026-02-13 17:24:18 -08:00
Alishahryar1
98966fe688
fixed table rendering v2
2026-02-13 16:57:14 -08:00
Alishahryar1
28a56d3af8
fixed table rendering for telegram
2026-02-13 16:31:46 -08:00
Alishahryar1
4ee0114891
Implemented /clear command
2026-02-13 16:24:52 -08:00
Alishahryar1
459ce6e8fd
introduced per reply /stop command to stop just that task and fixed context leakage in reply session forking
2026-02-13 14:53:48 -08:00
Alishahryar1
42bfb2da9b
improve test coverage
2026-02-13 12:54:48 -08:00
Alishahryar1
ff22e9baa2
lint
2026-02-08 04:10:57 -08:00
Alishahryar1
697bc37faf
Upon dequeue the current request immediately displays processing state instead of position 1 waiting
2026-02-08 04:06:41 -08:00
Alishahryar1
6d8f13d84e
Added feature to update queue positions on telegram when messages are dequeued and added new tests
2026-02-08 04:00:58 -08:00
Alishahryar1
0cad642e4b
Implemented markdownv2 rendering
2026-02-05 17:31:40 -08:00
Alishahryar1
3a69a51f62
fixed markdown errors for telegram
2026-02-05 17:22:00 -08:00
Alishahryar1
fcbe204f44
Major refactor done with kimi-k2.5 in claude code
2026-02-05 10:51:33 -08:00
Alishahryar1
78d0276d03
fixed /stop
2026-01-31 14:39:24 -08:00
Alishahryar1
8ce86f4267
fixed type errors
2026-01-31 14:13:09 -08:00
Alishahryar1
303767e346
fixed linter errors
2026-01-30 23:32:02 -08:00
Alishahryar1
07b0c9233e
switched to start truncation from end truncation
2026-01-30 17:05:23 -08:00
Alishahryar1
5d26bdbb9f
fixed /stop race condition
2026-01-30 17:01:41 -08:00
Alishahryar1
e6bf052edf
fixed /stop
2026-01-30 16:58:33 -08:00
Alishahryar1
8aae7c3d3d
fixed redundant telegram calls
2026-01-30 15:46:49 -08:00
Alishahryar1
7045e0ed44
add retry for telegram message edits with tests and updated rate telegram limit
2026-01-30 15:41:24 -08:00
Alishahryar1
3b037932d7
refactor to reduce coupling
2026-01-30 13:39:40 -08:00
Alishahryar1
f7f5b98590
more robust error handling by telegram bot
2026-01-30 00:54:16 -08:00
Alishahryar1
602a616fdd
fixed handler bypassing rate limiter
2026-01-29 23:30:14 -08:00
Alishahryar1
2a84823825
added rate limiter for telegram to prevent flood wait
2026-01-29 23:25:55 -08:00
Alishahryar1
5e44e13048
Revert "fixed telegram rate limiter"
...
This reverts commit db57d4d3d2 .
2026-01-29 23:14:29 -08:00
Alishahryar1
db57d4d3d2
fixed telegram rate limiter
2026-01-29 23:06:31 -08:00
Alishahryar1
b2b5a5a1d4
Fixed streaming bugs and added better logging
2026-01-29 21:40:20 -08:00
Alishahryar1
7a25c967b0
moved rate limiting to the api level
2026-01-29 18:59:25 -08:00
Alishahryar1
5fd7268d3f
added tree based session handler
2026-01-29 18:17:42 -08:00
Alishahryar1
2c6b40012a
fixed replies to pending incorrectly starting a new cli when they should be queued
2026-01-29 17:12:23 -08:00
Alishahryar1
34035dfc05
fixed /stop not updating ui for all messages
2026-01-29 17:04:30 -08:00