tools/ holds model tools. These three files register none: they send a
message to a platform for `hermes send` and for cron delivery, through
gateway adapters and gateway config. They move to the gateway package:
tools/send_message_tool.py -> gateway/outbound/send.py
tools/send_message_senders.py -> gateway/outbound/senders.py
tools/send_message_targets.py -> gateway/outbound/targets.py
Twelve test files move with them to tests/gateway/outbound/. Every importer
changes its import line in place. Nothing stays at the old paths: none of
the three names is on the plugin API list, the shipped-release list or the
old-updater list.
Behaviour is unchanged. The logger name stays tools.send_message_tool in
the three files and in the QQ Bot sender that shares it, so the lines stay
under `hermes logs --component tools`. The boundary-lint baseline changes
12 keys and no count, because its keys carry the module path of the
underscore names five bundled plugins import.
The import and docs rewrites were made by scripts/move/rewrite_imports.py
and rewrite_docs.py.
tools/ holds model tools. These three files register none and do cron's
work, so they move to the package that owns it:
tools/cronjob_job_args.py -> cron/job_args.py
tools/cronjob_prompt_scan.py -> cron/prompt_scan.py
tools/blueprints.py -> cron/skill_blueprints.py
Their tests move with them to tests/cron/. Every importer changes its
import line in place, so no module is imported earlier or later than
before. Nothing stays at the old paths: none of the three names is on the
plugin API list, the shipped-release list or the old-updater list.
skill_blueprints, not blueprints: cron/blueprint_catalog.py already holds
Automation Blueprints, a different thing. This file reads the blueprint
block of a skill's frontmatter.
Behaviour is the same except two strings. The report of a run the
injection scanner blocked names cron/prompt_scan.py. The one debug line
in skill_blueprints logs as cron.skill_blueprints, so it shows under
`hermes logs --component cron`. job_args and prompt_scan keep the logger
name tools.cronjob_tools.
The import and docs rewrites were made by scripts/move/rewrite_imports.py
and rewrite_docs.py; the two gateway contract files are regenerated from
the docstring that names job_args.py.
utils.py held three subjects in one 871-line file. It is now a package with
one module per subject: utils/files.py (atomic writes, temp files, file mode
and owner, signatures and digests, JSON and YAML file helpers), utils/urls.py
(the base_url helpers) and utils/env.py (truthy values, env numbers, proxy
env helpers). utils/__init__.py re-exports every public name, so no importer
changes. Function bodies are unchanged, no function-level import moved, and
the logger keeps the name "utils".
Tests patch a name in the module that now defines it. Patches stay on the
package where production reads the name through a function-level
"from utils import". The tests of utils itself move to tests/utils/.
A root module that becomes a folder drops out of anything that copies root
*.py files plus a fixed list of packages, so the fixtures that build a partial
source tree now list utils, as do pyproject's packages.find, three check
scripts and the CI change classifier.
Removed. A search for callers by name, attribute and string (Python, TypeScript,
docs, the plugin API list and the frozen old-updater list) finds no supported
path that reaches any of them:
- tools/skills_hub_github.py: unused imports subprocess, windows_hide_flags
- tools/skills_hub_github.py::GitHubSource._parse_frontmatter_quick (tests now call
skills_hub_models._parse_frontmatter directly)
- tools/skills_hub_clawhub.py::ClawHubSource._query_terms/_dedupe_results/_search_score
- tools/skills_hub_skillssh.py::SkillsShSource._strip_html
- tools/skills_hub_official.py::OptionalSkillSource._parse_frontmatter
- tools/skill_lock.py::locked_skill_dirs
- tools/blueprints.py::create_blueprint_job, export_blueprint, _schedule_to_string
(and their tests in tests/tools/test_blueprints.py)
Also:
- creating-skills.md no longer promises exporting a cron job back to a SKILL.md
(no code implements it)
- TestBlueprintBridge in tests/cron/test_suggestions.py asserts the job spec carries
`deliver`, the coverage test_bridges_to_create_job had
- TestParseFrontmatterQuick is renamed TestParseFrontmatter
A run-outcome write persists the complete jobs.json store, not just the running job. Scrub legacy sticky failure details on every job in the write, preserving diagnostics and pause state. Test with an idle paused job carrying a pre-upgrade error and a separate healthy run.
Carrier: c2h5oh, NousResearch/hermes-agent#155835.
Original reporter: joseph050221, NousResearch/hermes-agent#102700.
(cherry picked from commit 7a0ec6aca8a9ad5efdec48b62b3ca0bb83baedf1)
The success-only scrub left a raw pre-#155355 last_failure on a cancelled
run, and a raw last_fire_error on failed and cancelled runs. Every outcome
rewrites jobs.json and keeps the stamps it doesn't replace, so scrub both
before branching on the outcome.
Refs #102700
A successful cron run keeps last_failure.detail for history but re-persisted
pre-redaction credentials from older jobs.json files. Scrub that retained
field at run-outcome bookkeeping while preserving its diagnostic text.
Regression: test_success_scrubs_preupgrade_sticky_failure
Builds on c2h5oh's #155355; original report #102700.
(cherry picked from commit 8786e3743d96fb64fb58874b25746a36f81749e4)
Each written body is a substring of the charged command, but the join of a
path's bodies is not: N paths each holding a large shared body plus a unique
append produced N distinct joins tokenized for free (80 mention-only paths:
7.4 s, main 0.14 s). Charge the join like any other text; drop empty bodies
before deciding whether a join exists.
Refs #127698
- _heredoc_write_targets tokenizes < and > apart from words, so cat >P<<'EOF',
cat > P<<'EOF', cat <<'EOF'>P and &>P map the body to P; no lstrip, so
>1.sh stays 1.sh.
- A written body's first scan is free (it is a substring of charged text);
any repeat is charged, so one tee body run from N paths no longer re-tokenizes
N times outside the whole-walk budget (#78398).
- Scan each written body as its own file version as well as their
concatenation: joined overwrites could form a masked cat <<'DOC' around a
restart the real file runs.
Refs #127698
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
Only the last body per path was kept, so write-then-run-then-overwrite and
repeated >> appends hid the script; and nested sh -c / su -c / env -S /
systemd-run payloads never saw the bodies their parent wrote. Keep every body,
share one written-script map down the walk, and scan a written body once
without charging it to the budget twice.
Refs #148561
The referenced-script walk reads scripts from disk, but `cat > P <<'EOF' ... EOF; systemd-run P`
creates P only when the command runs, and the quoted cat body is masked as documentation
(#88336), so the lifecycle guard never saw the script it was about to run. Map each path a
cat/tee heredoc writes to its body and recurse into that body when the same command executes
the path (bash/sh/systemd-run/nohup/./P). A body that is only written stays allowed.
Fixes#148561Fixes#127698
Finding 'Explicit topics get replaced': _target_matches_origin treats a missing origin thread as a
wildcard, so a job born outside any topic delivering to telegram:<chat>:<topic> counted as origin
and the opt-in swapped the chosen topic for a fresh thread. Require the target thread to be the
origin's own recorded thread.
A continuable cron job (attach_to_session / cron.mirror_delivery) opens a
fresh thread per run only when its origin pins no thread: b693bee100bd's guard
keeps a job created inside a Telegram topic delivering back to that topic.
That stays the default. platforms.<p>.extra.cron_fresh_thread_per_run: true
now lets the fresh-thread branch override the origin topic for deliveries to
the job's own conversation; an explicit chat_id:thread_id target to another
chat is never overridden. A non-boolean value keeps the origin topic and warns.
Fixes#76548
Greptile: Dashboard wrapping changes fail / Invalid inputs are accepted /
The input type excludes reset / The oversized store keeps growing.
wrap_response joins _DASHBOARD_UPDATABLE_FIELDS; CronJobCreate uses StrictBool;
cronjob() annotates bool | str; the catch_up and wrap_response tri-state
normalizers move to cron/jobs_tristate.py so cron/jobs.py is 3 lines under its
origin/main size.
Align with the open #57688, which replaces the same inline check in
_deliver_result with _should_wrap_cron_response(job, user_cfg) to deliver
no_agent output unwrapped. Using one name and signature means whichever PR
lands second merges into a single helper instead of two. The helper now
returns a real bool (truthiness of the global setting, as before).
Review follow-up.
- Storage: wrap_response used bool(v), so the string "false" (for example
from the dashboard's untyped update body) was stored as wrap-on. It now
goes through _normalize_wrap_response, which mirrors catch_up: only true,
false or null are accepted, anything else is a ValueError.
- Reset: the model tool reads every argument with args.get(), so it cannot
tell an omitted field from an explicit null, and a job could never return
to the global cron.wrap_response once overridden. The tool parameter is
now a single-type string enum (on / off / inherit), with "inherit" as the
spelled-out reset; real booleans and None still pass through for the
programmatic, CLI and dashboard lanes. `hermes cron edit` gains
--inherit-wrap-response.
- The per-job precedence moved out of _deliver_result into
_effective_wrap_response (same fallbacks: an unreadable or malformed config
still wraps), keeping _deliver_result inside the complexity cap.
Tests (new file, 8 red on the previous code): off then inherit
clears the override, an omitted field leaves it alone, new jobs inherit,
the normaliser accepts only bool or null, a "false" string is rejected
without touching the stored value, and the CLI flag parses to the reset.
Precedence is covered for job override, global setting, unreadable config and
a malformed cron section.
Cron deliveries currently wrap output with a "Cronjob Response: ..." header
and a "To stop or manage this job..." footer (controlled globally by
cron.wrap_response). For some jobs - e.g. a morning briefing - the user
wants the raw, clean message body without the chrome.
Adds an optional per-job `wrap_response` boolean. None inherits the global
config (existing behaviour); True/False explicitly overrides it. Threaded
through create_job/update_job, the cronjob tool schema, the web API
CronJobCreate model, and the `hermes cron create/edit` CLI as
--wrap-response / --no-wrap-response.
* fix(cron): redact secrets before persisting errors to jobs.json/executions.db
cron/jobs.py::_mark_job_run_locked wrote raw error/delivery_error text
straight into jobs.json's last_error/last_delivery_error fields. When a
provider error embeds a key-management link (e.g. OpenRouter's
'.../workspaces/default/keys/<KEY_ID>' 403 body), the key identifier
was persisted verbatim and survived indefinitely across restarts, job
edits, and profile backups.
cron/incidents.py::_redact_error and cron/delivery_queue.py::_finish
already sanitize before persisting; jobs.json was the one cron
persistence chokepoint left raw. Fix the whole class, not just the
reported field:
- agent/redact.py: new _KEY_MANAGEMENT_URL_PATH_RE, applied
unconditionally in redact_sensitive_text — masks /keys/<id> and
/api-keys/<id> path segments (not caught by the existing sk-/ghp_-
style prefix patterns).
- cron/jobs.py: new _sanitize_persisted_error() (redact + bound to
2000 chars, mirroring incidents.py's MAX_ERROR_CHARS convention).
Applied at every raw-error write site: _mark_job_run_locked
(last_error, last_delivery_error) and note_fire_forward_failure
(last_fire_error.detail).
- cron/scheduler.py: the post-interrupt update_job({last_delivery_error})
path bypasses mark_job_run — sanitized there too.
- cron/executions.py: finish_execution() writes to the durable
executions.db SQLite ledger, same exposure class as jobs.json
(survives restarts) — sanitized there too.
Closes#102700.
Tests: tests/cron/test_cron_jobs_error_redaction.py (new, 10 cases)
covers the OpenRouter key-URL example from the issue, None/empty
passthrough, length bounding, redactor-failure fail-closed behavior,
and each of the four write sites. Full tests/cron/ suite: 1164/1175
passing (the 11 failures are pre-existing on unmodified main — Windows
HOME/path env issues and one process-timing flake, confirmed
unrelated by running the same files against main before this change).
tests/agent/test_redact.py (116) and tests/test_redaction_registry.py
(19) pass unchanged, confirming no regression to the shared redactor.
* fix(cron): fail closed and cover last_failure/receipt recovery when scrubbing persisted errors
Follow-up to the salvaged commit: a redactor failure now stores a
placeholder instead of the unscanned text, the sticky last_failure
detail and recover_receipted_execution's ledger write go through the
same scrub, and the unconditional /keys/<id> regex is dropped (key IDs
are not credentials and it rewrote unrelated URLs).
Fixes#102700
* fix(cron): scrub the unverified-admission reason before persisting it
The CronExecutionUnknown path wrote str(e) raw to jobs.json paused_reason and
executions.db error. Sanitize once and pass the same string to both, so the
receipt that later proves the run terminal still matches the pause it lifts.
Refs #102700
* refactor(cron): move persisted-error scrubber to cron/jobs_error_text.py
cron/jobs.py is over its size cap and only grew through an unrelated file-level
waiver; the helper now lives in a sibling with a public name, so executions.py,
scheduler.py and scheduler_bookkeeping.py stop importing a private name from
cron.jobs. jobs.py reads it through the module attribute, so one monkeypatch on
cron.jobs_error_text covers every caller. jobs.py is net 0 lines vs main.
Also pins the receipt-recovery and interrupted-run scrub sites and the
redact_url_credentials flag: each mutant now fails exactly its own test.
Refs #102700
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
* fix(cron): cap the queued-delivery error settled onto jobs.json
delivery_queue._finish redacts the row's error but does not bound it, and
_settle_job_record copied it straight into last_delivery_error - the one writer
of that field that skipped the 2,000-char cap. Run it through
sanitize_persisted_error and compare the stored form in the no-op check.
Refs #102700
---------
Co-authored-by: joaomarcos <joaomarcosdias444@gmail.com>
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
The [CURRENT RUN TIME: ...] line was always rendered in the profile
zone. A 09:00 America/New_York job fired from a Los Angeles profile was
told "06:00 PST", so the expression, the fire and the time the model
reads disagreed on the wall clock (a pre-market brief would reason it
is three hours before the open). _run_time_line now takes the job and
converts to its pinned zone; unpinned and corrupt-pin jobs keep the
profile zone, byte-identical to before.
A benign prompt with deliver=bot-chat:<unknown profile> must be refused before
the job is stored; dropping _validate_bot_chat_deliver from the guard now fails.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
Slot values are interpolated into the stored prompt; the slash shortcut now runs
_scan_cron_prompt and the bot-chat deliver check like the cronjob tool and the
dashboard blueprint instantiate.
A user .env (load_hermes_dotenv, override=True), reload_env() and a
user-configured secret source (registry.apply_all) could all set or
override HERMES_MANAGED_DIR, repointing managed scope at a directory the
user controls and voiding administrator policy even when the variable
was baked into the service unit or container image (#135200).
Introduce LAUNCH_ONLY_ENV_KEYS in hermes_constants and skip those keys in
all three write paths; the key is also no longer recorded as dotenv
residue and is process-global in secret_scope, so routed-profile
children keep the launch value instead of silently losing managed
scope.
Review M1 (Mark S.): a standalone send that may have landed (the Telegram
sender's "delivery: uncertain" after a lost acknowledgement, or an exception
escaping the sender) set standalone_in_flight but did not count as reached,
so the manual-run completion copied the report into the invoking
conversation. Count it as reached; error/status reporting and the no-replay
rule are unchanged.
Co-authored-by: Mark S. <theoldwizard123@pm.me>
Re-review P2 "A partially delivered standalone report is falsely classified as
reaching nobody": the Telegram standalone sender landed chunks 1-2 of a split
report, failed on chunk 3, and _deliver_standalone returned None, so
last_delivery_reached_none was True and _manual_run_completion pasted the full
report into the invoking topic although its head was already in the target chat.
_deliver_standalone now reads the shared delivery-outcome contract
(gateway.platforms._shared.delivery_state, from #153474): a PARTIAL failure
counts the target as reached while still reporting the error and still never
queueing a replay.
Greptile finding (Reports reach the wrong topic): last_delivery_error is also
set by a partial failure (one target sent, another refused) or a dropped
attachment, so keying the excerpt on it copied an already-posted report into
the invoking topic again. _deliver_result now records
last_delivery_reached_none (errors and zero targets reached), and the
completion keeps the excerpt only then.
Review finding: removing the Slack-only check moved existing Matrix/Mattermost
room jobs into the creation message's synthetic reply thread. Other platforms
keep main's top-level delivery.
A job created from inside a topic stores that lane in `origin.thread_id`, but its
delivery target is usually written as an explicit `platform:chat_id` pair — the form the
`cronjob` tool, the dashboard and hand-edited `jobs.json` all produce. That pair names no
thread, and only Slack inherited the origin thread for it, so on Telegram (DM topics and
forum supergroups alike), Discord threads and Matrix threads the report fell into the
chat's top-level/General lane instead of the lane the user scheduled from.
Production evidence, Telegram DM topics, jobs firing daily: one
`origin has thread_id=… but delivery target lost it` warning per fire, 38 in a single
`agent.log` rotation. Resolving the live `jobs.json` with the unpatched code reproduces it
— six enabled jobs resolve `thread_id=None`; with this change all six resolve to their
origin thread, and the two jobs that have no origin thread are untouched.
The inherit stays scoped to the origin conversation (same platform, same chat) and never
overrides an explicit thread, so a fan-out target cannot be redirected into a topic it was
not addressed to. Slack's stale per-message session key is still excluded through
`_origin_thread_is_stale` (Slack-only, unchanged); a caller that genuinely wants the
top-level lane of its own chat keeps the platform's General sentinel
(`telegram:<chat>:1`), which parses to a thread id before the inherit runs.
E2E through the owner bridge (session_cron.execute -> _profile_runtime_scope -> to_thread(run_job))
and the real local terminal backend. Guards the #77464 comment's repro: a shared session-less
terminal env pinned the first creator's HERMES_HOME in its bash snapshot.
Refs #77464
Follow-up to the salvaged fix: the raw set_secret_scope call trips HX016
(new legacy profile setter). bind_state binds home + secrets only, with no
terminal policy and no per-tick source hydration. The process home stays
unstamped, matching the launch identity. Also covers the gateway's real
whole-profile bind and an unscoped satellite process whose os.environ holds
a same-named key.
Fixes#148606
_primary_profile_routes_for_current_home runs inside a satellite's profile
scope but reads the primary home's config.yaml, so ${env:...} refs resolved
against the satellite's .env (fail-closed): per-tick 'keeping the literal
placeholder' warnings and cross-profile substitution of same-named keys.
Fixes#148606
httpx decodes gzip/br before iter_bytes() yields, so a few KB of brotli
inflated to GBs before MAX_URL_BYTES applied. Ask for identity and read
raw bytes, as the urllib path on main did. Also name
security.allow_private_urls in the blocked alert and docs.
Co-authored-by: BearHuddleston <BearHuddleston@users.noreply.github.com>
An empty hits list satisfied the old assertions, so a request failing before
/redirect looked like successful SSRF protection. Assert the blocked-message and
that exactly the redirect hop was served.
monitor_url used bare urllib.urlopen with only a scheme check, and urllib
follows redirects itself, so a direct or redirected URL could reach
loopback, private-network or metadata endpoints and the body was injected
into the cron agent's prompt. Fetch through create_ssrf_safe_client with
redirects followed manually and is_safe_url checked on each hop (same
pattern as agent/provider_media.py); the body stays capped at
MAX_URL_BYTES and is now read in a stream.
Fixes#81406
Co-authored-by: fangliquanflq <fangliquan@qq.com>
Re-review P2 "Standalone partial split sends still leave delivered continuation
chunks unmarked": the Telegram standalone sender landed chunks 501 and 502,
failed on chunk 3, and its exception handler dropped the chunk ids;
_deliver_standalone returned before record_cron_delivery, so a reply to 502
reached the model as a bare quote instead of a past report.
Stacked on #153474's delivery-outcome contract (gateway.platforms._shared):
standalone results carry delivered_message_ids on success AND on a partial
failure. The PR's own ad-hoc raw_response["message_ids"] in the Telegram sender is
replaced by that field, record_cron_delivery reads it, and _deliver_standalone
records the landed ids on its failure path too.
Greptile finding (Worker startup can time out): a 50 ms confirm wait could
race the stand-in worker's start and test the never-dispatched fallback. The
fake loop now returns the future once the send has started, and the wait is 2 s.
Greptile finding (Slow sends leave chunks unmarked): the ids were recorded
only after the scheduler's 60 s confirmation wait, so a send still running at
the timeout, or a partial send (PartialDeliveryError), left its chunks unframed.
The tag now runs when the send itself finishes, in the run's profile context,
and includes the landed chunks of a partial result.
Review finding: only the first chunk of a delivery over the platform limit
carries the 'Cronjob Response:' header, so a reply to a later chunk reached
the model as a bare quote. Each delivered chunk id is tagged in the existing
sent index (rich_sent_store) on both delivery lanes, and the reply pointer
looks the replied-to id up there.
Re-review P1 "A final connect failure erases an earlier possibly delivered attempt
and queues a duplicate": the Telegram and QQBot standalone senders classified
"nothing sent" from the FINAL exception only. Telegram retries its own 5xx (may
follow a committed send) and QQBot walks to the next endpoint after a 5xx; when
the later request cannot connect, the result read retryable and cron queued the
full report for a post-reconnect replay.
One delivery-outcome contract for standalone senders now lives in
gateway.platforms._shared: DeliveryOutcome records every receipt and every
maybe-delivered attempt across the whole logical send (retries, endpoints,
chunks); failure() stamps delivery = partial / uncertain / none plus
delivered_message_ids, and only "none" keeps retryable. delivery_state() reads
any sender's dict (legacy envelopes: retryable = none, other errors = uncertain).
Telegram, QQBot and the shared _send_chunks loop write it; cron's
_deliver_standalone reads delivery_state() instead of the raw retryable bit.
Greptile on #153474 at 8b221185:
- "Live reports can arrive twice": SendResult.retryable means "can try again", and QQBot's live
_send_chunk also sets it after a reset that followed the message POST. The live-side gate now
requires a pre-send rejection (send_path_degraded, or "Not connected" marked retryable), never
the bare flag.
- "Refused reports lose their retry": Discord's standalone 4xx (429 included) is a refusal, so it
now carries nothing_sent; a 5xx stays unmarked. Telegram's rich path marks a connect/pool
failure or flood refusal as never_sent, so the standalone result is replayable again.
Finding "_deliver_to_platform reads retryable with getattr on dict results" (#153474 review,
confirming kvnloo's comment). A plain dict `{"success": False, "error": "Not connected",
"retryable": True}`, which `_send_result_error` already accepts, lost its verdict and the payload
was dropped. Both now read through one dict/attribute accessor.
Finding "lost-answer and partial standalone sends are queued for replay" (#153474 review).
The queue gate keyed on the ABSENCE of an uncertainty flag that only one Telegram path set, so a
rich-message timeout, a failure after chunk 1 landed, and every non-Telegram sender's plain error
dict (QQBot read timeout) were queued and the redelivery sweep posted the report a second time.
Inverted to positive proof: cron queues only when the standalone result carries an explicit
`retryable: True`, which a sender sets only when nothing reached the chat (no credential, a
refusal before any byte, or a connect/pool failure before the request left). Anything else,
including an exception escaping the sender that does not prove the request never left, is
treated as possibly delivered and not queued.
- gateway/platforms/_shared.py: `send_error(..., nothing_sent=True)` and `request_never_left()`
(connect/pool failure classes, chained causes included).
- Telegram: `retryable` only when no chunk landed and the error is a refusal, flood wait or
UNSENT; rich failures are never marked.
- QQBot, Discord, Slack, Teams: marked on missing credentials / pre-message token failures and
connect failures before anything landed. Photon no longer forwards the sidecar's own
retryable flag (it covers timeouts that may have delivered).
- `_send_chunks`: an error after a landed chunk drops `retryable`.
Telegram's standalone sender can time out after the write (PTB TimedOut, a reset mid-write)
and return an error dict well inside cron's outer timeout, so standalone_in_flight stayed
false and the report was queued; if Telegram had in fact posted it, the reconnect sweep
sent a second copy. The sender now marks a may-have-delivered failure delivery_uncertain
(the same classifier the adapter and album lanes use), and cron treats it as in flight.
A connect failure, where the request never left, is still queued.
_standalone_send returned a third in_flight element, which forced edits to
three origin/main tests that stub it with the two-tuple shape
(test_cron_reconnect_only_rejection.py, plus token fixtures in
test_cron_live_delivery_confirmation.py and test_warning_execution_outcome.py
that only existed for the dropped satellite skip). The timeout arm now sets
_TargetDelivery.standalone_in_flight instead, and those three files are
byte-identical to main.
The salvaged credential check read pconfig.token alone, but Telegram's
standalone sender falls back to the profile's scoped TELEGRAM_BOT_TOKEN.
A worker holding only that env token (the common single-profile install)
skipped the standalone lane it could have used: main's
tests/cron/test_delivery_outcome_writeback.py (e1de0c2665) went red.
The skip only saved a log line and a failed stamp on a send that fails
anyway; the queue gate after a definitive standalone failure already keeps
the payload, so drop it rather than re-derive every sender's credential
lookup.