Commit Graph

575 Commits

Author SHA1 Message Date
Mauvis Ledford e95dd466b1 fix(bot-mode): persist canonical chat before opening 2026-08-22 02:35:47 -07:00
kshitijk4poor cd80a7f36c chore: map contributor email epicstorage0@gmail.com 2026-08-22 14:55:04 +05:30
kshitijk4poor 3bdc2165c3 fix(state): scope salvage to repair-connection durability + live-writer guard
Follow-up to the salvaged repair-durability commit. Scope corrections so this
PR ships only the reachable, non-competing, WAL-mode-correct half:

- Drop verify_state_db_integrity() + its 4 tests. Zero production callers here
  (dead code); the caller lives in the follow-up that wires it into
  SessionStore._open_session_db_for_active_scope() (PR #91754). The function
  moves with its wiring.
- Drop the _db_fingerprint change (size:mtime_ns -> dev:ino:size) + its 3
  ledger tests. This is competing work: PR #88425 (salvage of @jirathip-k's
  #88224) already fixes the same size:mtime_ns budget-reset bug with a
  content-sample + volatile-header-mask that also handles the DELETE-mode
  commit-counter case, and carries @jirathip-k's diagnosis/credit. Landing a
  second, divergent fingerprint contract would stomp that lineage. Fingerprint
  stays with #88425; this PR reverts _db_fingerprint to main's form.
- Mark test_repair_refuses_while_another_connection_holds_the_db requires_wal.
  _live_writer_holds_db detects an out-of-process holder via the WAL-index
  exclusive lock, absent in journal_mode=DELETE (used on WAL-reset-vulnerable
  SQLite <3.51.3 incl. CI's 3.50.4, and on NFS/SMB). The test failed there;
  the conftest requires_wal gate auto-skips it. DELETE-mode limitation is now
  documented on the guard docstring: repair is serialised only by the
  cross-process repairer lock there. The reported incident was in WAL mode.
- Map dhanesh@users.noreply.github.com -> dhanesh (contributors/emails) so the
  attribution CI gate passes.

Net: this PR is repair-connection durability barriers + the live-writer guard.
addresses @andrexibiza's #90747 review (dead-code verifier + fingerprint
interlock with #88425).
2026-08-22 04:02:29 +05:30
Teknium 70151dd549 feat(update): updates.parked_branch_strategy gates the in-place merge; switch stays the default
Adapts the in-place branch update from PR #89507 (@willfrombr) onto the
switch-by-default behavior: the deterministic switch path remains the
default so non-interactive updates (desktop, gateway, cron) never dead-end
on a merge conflict, and deliberate custom-branch users opt in with
updates.parked_branch_strategy: update_in_place. --switch-branch overrides
the in-place strategy for one run (deep feature branches that must not
accumulate update merge commits). Docs + config comments + tests cover
all three routes.

Co-authored-by: Willian Santos <285090322+willfrombr@users.noreply.github.com>
2026-08-21 15:23:49 -07:00
Teknium 2dcb623956 chore: map salvage contributor emails 2026-08-21 15:02:29 -07:00
Good Chang 9e36774d77 fix(telegram): rebuild after cancellation-shielded stop
Use the existing wall-clock deadline helper for updater.stop() during network recovery. If PTB cleanup remains cancellation-shielded past the deadline, escalate to retryable fatal recovery so the runner builds a fresh adapter instead of calling start_polling() while the old Updater may still hold its lifecycle lock.

Add regression coverage with stop() swallowing cancellation while holding the same lock start_polling() needs, and verify the old Updater is never reused.
2026-08-22 03:20:48 +05:30
kshitijk4poor ac64f8a7e7 chore: AUTHOR_MAP — add samtcam@gmail.com → samclams
For PR #91806 salvage (multiplex refusal exit code fix).
2026-08-22 03:10:32 +05:30
Teknium bc8f49618c chore: map contributor email for S-Claw 2026-08-21 14:39:02 -07:00
Teknium 098a7acd4a add openclaww@gmail.com to contributors 2026-08-21 14:38:32 -07:00
ethernet b102999d80 add mike@vorburger.ch to contributors 2026-08-21 15:17:28 -04:00
kshitijk4poor 8b103cd130 chore: AUTHOR_MAP troy.rowe@re-source.au -> troyrowe-resource
Mapping for PR #90261 salvage (server-injected parameter 400 classifier).
2026-08-21 21:25:08 +05:30
Teknium a9ac2c6fc8 chore: map contributor email for paultaki 2026-08-21 03:51:03 -07:00
kshitijk4poor 8bdf0e89e2 chore: add qixuancao to AUTHOR_MAP 2026-08-21 16:12:57 +05:30
Teknium 7d0f06f75d chore: map contributor email for vinsew 2026-08-21 03:04:06 -07:00
Teknium 533886c8b8 chore: map contributor email for Lesnak1 2026-08-20 20:21:12 -07:00
Teknium 892ec7af57 chore: map contributor email for @zhongwater123 2026-08-20 19:42:09 -07:00
Teknium 9629653b94 chore: map contributor email for @zhaomengfan 2026-08-20 19:42:00 -07:00
Teknium 309e8837d1 chore: map contributor email for kadiratesdev 2026-08-20 19:41:03 -07:00
Teknium 7ab2e417f0 chore: map contributor email for attribution gate 2026-08-20 14:14:51 -07:00
Teknium 603d5651b3 chore: map contributor email for attribution gate 2026-08-20 13:53:28 -07:00
Teknium c32119b12c feat(config): default agent.max_turns to unlimited; accept inf/infinity/null spellings
Builds on @fattchris resolve_turn_limit salvage (#67696): flips the default
from a numeric cap to unlimited across all construction paths (CLI, agent_init,
run_agent subagents), adds inf/infinity/null to the unlimited spellings, and
sets DEFAULT_CONFIG agent.max_turns to null. The turn cap caused more problems
than it solved (silent mid-task truncation).
2026-08-20 04:50:39 -07:00
Teknium 90e477d3ed Merge remote-tracking branch 'origin/main' into feat/keyless-tavily-firecrawl-failover 2026-08-20 00:18:29 -07:00
kshitijk4poor 446da3ef56 fix(cli): widen lock-bit coverage to alias installers, legacy nav keys, and PUA functional keys
Follow-up to the salvaged #89676 + #90291 lock-bit fixes: extract a shared _lock_variants() helper and cover the sites both PRs missed - install_shift_enter_alias / install_ctrl_enter_alias / install_cmd_backspace_alias CSI-u spellings, legacy CSI-letter and CSI-tilde navigation twins derived from the existing table for ALL modifiers 1-16 (not just plain/shift), plain F1-F4 SS3 fallback, unmodified CSI-u keys (Tab/Enter/Space/Backspace), and kitty PUA functional keys (keypad, F13-F24, Ignore range) under lock bits. 8 new tests.
2026-08-20 12:16:20 +05:30
Teknium 8436e0d142 chore: map contributor email for #87427 salvage 2026-08-19 23:15:01 -07:00
kshitijk4poor 67029492d4 chore: map salvaged contributor emails (Dhruv7201, ekinnee) 2026-08-20 11:37:01 +05:30
Teknium c492379497 chore: map contributor email for Tavily salvage 2026-08-19 23:04:20 -07:00
Teknium e7091d5fb7 chore: map contributor email for GarlicGo 2026-08-19 19:41:52 -07:00
Owenz-creator 8408edcfb5 fix(bot-mode): protect ordinary sessions from hide sweep 2026-08-19 19:30:28 -07:00
Teknium 271e49a8ff fix(bot-mode): accept both host.connections() shapes in the Create-on picker normalize
The SDK now returns the registry rows per its documented contract
(salvaged #89893), while desktops predating the SDK unwrap resolve the
raw registry envelope. The plugin normalize accepts both, so the picker
works across the transition; regression test updated to pin the
dual-shape normalize.
2026-08-19 16:10:10 -07:00
kshitijk4poor c7b6854ba1 chore: map contributor email for #89969 salvage
f4lko@pm.me -> thacid22. The email is linked to the thacid22 GitHub
account on the PR's commit, so check-attribution can resolve it once
the mapping file exists on the branch.
2026-08-20 03:15:14 +05:30
Teknium ce9d48ce85 chore: map contributor email for Haik-G 2026-08-19 14:44:36 -07:00
Yingliang Zhang 7e3775de2e chore: map contributor emails 2026-08-20 00:03:50 +05:30
a 8d0e3ab814 chore: map contributor email for yingliang-zhang 2026-08-20 00:03:50 +05:30
Teknium bdc5b1f74c chore: map contributor email for noahingh 2026-08-19 10:19:35 -07:00
69k4xmdfm2-blip 21260c3281 fix(gateway): carry the profile in adapter-derived session keys (#88404)
Adapter ingress derives a session key BEFORE the runner stamps
source.profile in _make_profile_message_handler, so the namespace fell
back to the active profile and every bot in a multiplexed gateway
produced agent:main:<platform>:<chat>. A Telegram private chat reports
the user's own id as chat.id, identical for every bot, so two profiles
sharing one human collapsed onto a single lane: _pending_text_batches,
_active_sessions, the busy-session guard and _post_delivery_callbacks are
all keyed on that string. A day of production logs across two bots shows
60 flushes, none carrying the secondary profile's namespace.

set_owner_profile records credential ownership on the adapter and
_session_key_profile resolves the namespace as source.profile ->
_owner_profile -> the session store's resolver, so a secondary adapter
keys into its own namespace even before the source is stamped. Stamped
sources keep priority, so relay/connector ingress, which routes per event
rather than per credential, is unchanged. _configure_profile_adapter
installs the owner alongside the other handlers, covering startup and
reconnect.

Every candidate is type-checked as a non-blank str, and every attribute
read goes through getattr: adapters are routinely built without
BasePlatformAdapter.__init__, and a duck-typed session store returns a
truthy non-string that would otherwise be interpolated into the key as
agent:<MagicMock ...>:.

Also routes the four call sites that passed no profile at all (feishu
media batches, raft, slack _session_key_for_source, telegram photo
batches) through the same resolver.

test_multiplex_busy_input_mode's secondary-adapter busy case seeded
_active_sessions with the unstamped agent:main: key, asserting the
pre-fix collapse. It now seeds the lane the profile-owned adapter
actually derives.

A primary adapter has no owner and an unstamped source, so it resolves
exactly as before; with multiplex_profiles off the resolver returns None
and every key is byte-identical to today's.
2026-08-19 02:00:16 -07:00
Teknium 5a3410eb9a chore: map contributor email for salvage attribution 2026-08-19 01:58:21 -07:00
Teknium b154046e4e chore: map contributor email for zhuermu 2026-08-19 01:19:37 -07:00
marketing2981 ed47d41dc9 fix(desktop): bot navigation no longer forces the all-profiles sidebar on
Every host.openSession call in the Bot Mode plugin omitted
keepAllProfilesScope, so the SDK applied its default and flipped
$showAllProfiles back on whenever the target session belonged to a
different profile than the live gateway (sdk/index.ts:
options.keepAllProfilesScope !== false => setShowAllProfiles(true)).

For anyone running more than one profile this silently undid the sidebar
profile filter: narrow Sessions to one profile, click any other bot, and
the unified all-profiles list came back.

Bot navigation is an explicit context switch into that bot's profile, so
pass keepAllProfilesScope: false at every openSession call site (4 on
current main after the plugin.js refactor consolidated the original 7).

Salvaged from PR #89031 onto current main; includes contributor mapping.
2026-08-18 21:52:41 -07:00
Jay 104ec97595 fix(bot-mode): group room preview shows the bot handle, not @default
`botHandle()` exists so that, per its own comment, "the word 'default'
never surfaces in the UI" — it presents the primary profile as `hermes`.
The roster rows, mention resolution and the group-chat prompt all route
through it. Two preview paths did not, and rendered the raw profile name:

- `GroupRow`'s room preview line built `@${last.from?.name}`, so a group
  room read `@default: …` while the bot answers to `@hermes`.
- `previewKind()` returned the raw captured name from the bot-to-bot
  delivery prefix, so the `🤖 @<name>` badge and its tooltip could show
  `@default` too.

The mismatch is presentation-only, but it reads as a routing bug: the
room says the message came from `@default` while `@default` is not a
handle the mention resolver accepts, so users reasonably conclude
bot-to-bot addressing is broken when it is working correctly.

Both paths now map through `botHandle()`. `GroupRow` passes the matching
member so a bot with a custom handle keeps it; `previewKind` maps the
lowercased sender name, which leaves every non-primary profile unchanged.

Tests: the primary profile resolves to `hermes` and a named profile keeps
its own handle (behavioural, in the existing previewKind suite), plus a
source-shape assertion for the render path matching that file's
convention. Both new assertions fail against the pre-fix source.

Fixes #89484
2026-08-18 21:50:31 -07:00
Axl Ibiza, MBA 693c0e1c62 chore: remove case-colliding agent@Agents-Mac-mini.local contributor entries
The tracked contributors/emails/agent@Agents-Mac-mini.local and
agent@agents-Mac-mini.local differ only by case, which cannot materialize on
case-insensitive filesystems and surfaces one of them as perpetually modified
in git status, breaking clean checkouts. These entries are stale agent
identifiers, not real contributors; remove both.
2026-08-18 16:27:32 -07:00
Axl Ibiza, MBA 0ee9bc8d1e fix(agent): give interrupted-turn hidden placeholder a neutral provider-replay sidecar
Bot-mode interrupted member turns with no visible assistant text persisted an
empty assistant row (content="" + display_kind="hidden"). The pre-call
sanitizer repair_empty_non_final_messages() re-healed that row on every later
call (wire copy only), so the loop never converged (#88955).

Stamp api_content="[response interrupted]" (the canonical
_INTERRUPTED_PLACEHOLDER) on the hidden placeholder instead. display_kind is
stripped before sanitization, but api_content is projected back into content
for historical assistant rows, so the provider sees a non-empty neutral turn
and the sanitizer stops touching the row — while the durable transcript stays
hidden and empty. Uses the neutral interruption text, never the
_INTERRUPTED_SCAFFOLD_MARKER, which replaying as assistant text caused #81841.

Adds regression coverage proving (A) the placeholder carries the replay
sidecar, (B) two consecutive projections converge without sanitizer healing,
(C) the sanitizer still repairs genuinely-empty unmarked assistants.

Refs #88955
2026-08-18 16:27:32 -07:00
Teknium c7d0f6c35f fix(providers): honor a custom base_url over models_url in fetch_models
Follow-up to the salvaged CommandCode signature fix: accepting base_url
but ignoring it left custom endpoints (user-configured model.base_url /
COMMANDCODE_BASE_URL proxies) fetching the public catalog instead of the
configured one. Reviewer dansigma flagged this on PR #88851.

Class-wide fix, not a CommandCode patch:

- providers/base.py: a caller base_url that DIFFERS from the profile's
  default now wins over models_url. Equality with the default means "not
  customised" (callers pass base_url unconditionally, defaulting to the
  profile's own URL) and keeps models_url as the endpoint, preserving the
  OpenRouter-style split-catalog behavior.
- commandcode: _fetch_commandcode_models() takes the endpoint override;
  both profile overrides forward base_url.
- Tests: base-class precedence (custom beats models_url, default does
  not), CommandCode redirect via live local HTTP server incl. claude-*
  filter, and default-echo hitting the canonical endpoint. All verified
  to fail against the pre-fix implementation (sabotage run).
2026-08-18 14:27:36 -07:00
Teknium 38b7a40382 chore: map whisky0809 contributor email 2026-08-18 14:19:39 -07:00
Peter 6a3ef22346 fix(desktop): render math and missing markdown elements in .md file preview
The preview renderer for .md files was missing the math plugin, table/image/link components, and the markdown preprocessing pipeline that the chat transcript renderer has. Add KaTeX math rendering (inline $...$ and block $$...$$), table, image, and link support so file previews match the chat rendering.
2026-08-18 13:18:41 -07:00
Teknium de213b5210 chore: add contributor email mappings for vadelma-agent and tmielika
Maps vadelma@agenttiklubi.org and the bare noreply address to
vadelma-agent, and taneli.mielikainen@iki.fi to tmielika, so the
check-attribution gate passes on their open PRs (#70667, #72671,
#67934, #86255, #89194).
2026-08-18 12:38:10 -07:00
Teknium 9d8ae051dc chore: map lazy-idler contributor email 2026-08-18 12:37:38 -07:00
Teknium ef5bec0e14 chore: map contributor citizendev9c 2026-08-18 12:22:44 -07:00
Teknium e624e9fde5 chore: map contributor email for #88864 salvage 2026-08-18 00:26:31 -07:00
Teknium d4a72b7d7e chore: map contributor email for #88807 salvage 2026-08-18 00:03:16 -07:00
imMxts 7e156c6d2e fix(desktop): preserve primary remote connection identity 2026-08-17 23:52:54 -07:00