Commit 678c3c4
Bundles four rc4 features plus a CHANGELOG entry for #283 (diff_preview gate,
already on dev as 8c04904). Full details in CHANGELOG.md.
#269/#285 hot-reload triggers: merged separately as PR #285 (squash-merged to
dev); this commit extends TriggerManager with rc4 helpers (remove_cron,
crons_for_chat, webhooks_for_chat, cron_ids, webhook_ids) for Features 4b and
5 below.
#288 — /at command and run_once cron flag:
- new telegram/at_scheduler.py — module-level task-group + run_job holder;
schedule_delayed_run(), cancel_pending_for_chat(), active_count();
per-chat cap of 20 pending delays
- new telegram/commands/at.py — AtCommand backend, /at <duration> <prompt>
with Ns/Nm/Nh suffixes, 60s-24h range
- /cancel integration via cancel_pending_for_chat()
- drain integration via active_count() in _drain_and_exit
- entry-point at = untether.telegram.commands.at:BACKEND
- CronConfig.run_once: bool = False; scheduler removes cron after fire
if run_once=True; re-enters on reload/restart
#286 — unfreeze TelegramBridgeConfig:
- drop frozen=True (slots preserved); add update_from(settings) method
- route_update() reads cfg.allowed_user_ids live; handle_reload() calls
update_from() and refreshes state.forward_coalesce_s / media_group_debounce_s
- restart-only keys still warn (bot_token, chat_id, session_mode, topics,
message_overflow); others hot-reload
#271 — trigger visibility Tier 1:
- new triggers/describe.py — describe_cron(schedule, timezone) utility
- /ping shows per-chat trigger indicator when triggers target the chat
- RunContext.trigger_source field; dispatcher sets it to cron:<id>/webhook:<id>;
runner_bridge seeds progress_tracker.meta['trigger'] with icon + source;
ProgressTracker.note_event merges engine meta over dispatcher meta
- format_meta_line() appends 'trigger' to footer parts
- CommandContext gains trigger_manager, default_chat_id fields (default None);
populated by telegram/commands/dispatch.py from cfg
#287 — graceful restart Tier 1:
- new sdnotify.py — stdlib sd_notify client (READY=1 / STOPPING=1);
poll_updates sends READY=1 after _send_startup succeeds;
_drain_and_exit sends STOPPING=1 at drain start
- new telegram/offset_persistence.py — DebouncedOffsetWriter; loads saved
update_id on startup, persists via on_offset_advanced callback in
poll_incoming; flushes in poll_updates finally block
- contrib/untether.service: Type=notify, NotifyAccess=main, RestartSec=2
Tests: +224 tests added across 6 new test files and 6 extended files;
2164 total tests pass with 81.55% coverage.
Context files (CLAUDE.md, .claude/rules/*) and human docs (README, triggers
reference, dev-instance, integration-testing, webhooks-and-cron how-to,
commands-and-directives) updated. rc4 integration test scenarios R1-R10
added to integration-testing.md.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 3931d6b commit 678c3c4
File tree
44 files changed
+2374
-46
lines changed- .claude/rules
- contrib
- docs
- how-to
- reference
- triggers
- src/untether
- telegram
- commands
- triggers
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
44 files changed
+2374
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
62 | 78 | | |
63 | 79 | | |
64 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
52 | 87 | | |
53 | 88 | | |
54 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| |||
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
89 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
| |||
205 | 215 | | |
206 | 216 | | |
207 | 217 | | |
208 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
209 | 225 | | |
210 | 226 | | |
211 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
| 183 | + | |
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
14 | 23 | | |
15 | 24 | | |
16 | 25 | | |
| |||
29 | 38 | | |
30 | 39 | | |
31 | 40 | | |
32 | | - | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | | - | |
| 45 | + | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
| |||
0 commit comments