Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

Commits on main

style: prettier-format the support-url change
M3gA-Mind committed 3 months ago
713c8d1
fix(support): only append the Sentry ref where the destination consumes it\n\ntinysweeper's review point on #5953: the crash screen appends\n`?ref=<sentryEventId>` to SUPPORT_URL, and a Discord invite renders a join\npage and drops the query. The link still resolves — verified, 200, and the ref\neven survives the redirect to discord.com — but nothing consumes it, so the\ncorrelation the ref exists for silently stops happening while the URL still\nlooks like it carries the crash id.\n\nAdds SUPPORT_URL_ACCEPTS_REF, true only when VITE_SUPPORT_URL names a real\nsupport endpoint. The crash screen opens the bare URL when it is false; the\nSentry `support_url` tag is omitted entirely rather than degraded to a\nconstant string on every event, which would be noise rather than a deep link.\nThe Error ID stays copyable on the crash screen, so the path into a Discord\nthread is unchanged — what goes away is the false promise.\n\nAlso imports DISCORD_INVITE_URL from links.ts instead of repeating the literal\n(links.ts has no imports, so there is no cycle), and rewrites the doc comment,\nwhich still described a correlation mechanism the new default cannot honour.\n\nCoverage: the existing tests both `vi.mock` utils/config, so nothing observed\nthe shipped constant — reverting it to the dead /support URL left the suite\ngreen. supportUrl.test.ts reads the real module (dynamic import after an\nexplicit unmock, since a sibling file's mock of the same path otherwise reaches\nit) and closes that. Verified: 50 passed across the three files; with the URL\nreverted, 2 fail.\n
M3gA-Mind committed 3 months ago
6e5816a
Merge upstream/main into agent-turn-transcript
M3gA-Mind committed 3 months ago
77d1e10
fix(devices): accept the numeric pairingExpiresAt and surface a refused register\n\nTwo defects found while reviewing this PR, both in the path #5871 reports.\n\n**The backend sends `pairingExpiresAt` as a number.** `TunnelRegisterAck`\n(backend `socketHandlers/tunnel/types.ts`) types it `number` and `handler.ts`\nfills it with `Date.getTime()`, but the field here is `String` with no custom\ndeserializer — so a *successful* register ACK could not deserialize at all\n(`invalid type: integer, expected a string`). Accept either shape and normalise\nepoch milliseconds to ISO 8601, rather than widening the field to `i64`:\n`PairingSession::expires_at` and `CreatePairingResponse::expires_at` are both\ndocumented as ISO 8601 and are handed to the paired device.\n\n**A refused register was reported as a client parse error.** The backend answers\nfailures with `{ ok: false, error }` and no `channelId`; feeding that to the\nsuccess shape yields `missing field 'channelId'` — verbatim the error in #5871 —\nand discards the reason the backend gave. Check the failure envelope first and\nreturn the backend's message.\n\nThe ACK decision moved into `parse_register_ack` so it is reachable without a\nlive `SocketManager`. That is not cosmetic: the first version of these tests\nasserted on the `backend_ack_error` predicate alone, and a revert-check showed\nthey still passed with the check deleted from the call path — they pinned the\nhelper, not the behaviour. Testing through `parse_register_ack` fixes that.\n\nRevert-checked, each fix separately, because one revert cannot exercise both:\n\n - envelope check removed -> 2 failures, both naming their own assertion\n - deserializer detached -> 2 failures, including the successful-ack case\n - baseline and restored -> 7/7\n\nThe camelCase/snake_case aliases from the original commits are kept: they are\nadditive and harmless. Note for the author — the PR body's premise looks\ninverted. Backend #709 *introduced* the camelCase shape (its own diff adds\n`+ channelId: string;` and `+ pairingExpiresAt: number;`) and `main` still sends\nit, so the aliases match a shape nothing currently emits. The body also\ndescribes logging `raw ack = {ack}`, which would put the `pairing_token` bearer\ncredential in logs; the code correctly logs key names only.\n
M3gA-Mind committed 3 months ago
4afc8bb
fix(auth): corroborate a chat-error session expiry before destroying the profile\n\nThe chat-error dispatch added by this PR reached `runReauth` as `confirmed`,\nwhich by design SKIPS `confirmSessionTokenGone()` and runs the destructive\n`clearSession()` (`auth_clear_session` deletes the on-disk auth profile).\n\n`error_type: 'session_expired'` is not only a backend expiry.\n`web_errors_part_02.rs:36` classifies through `is_session_expired_message`,\nwhich also matches "no backend session token" and "session jwt required"\n(`core/observability.rs:1062-1064`). Those are LOCAL guards, not backend\nverdicts: they fire transiently before the core has read the on-disk auth\nprofile. Treating them as definitive is #2758 — "a forced re-login even though\nthe token survived the restart" — and this reintroduced it through a new door.\n`runReauth`'s own comment names both strings as the case corroboration exists\nfor.\n\nIt does not need the bootstrap path to bite; plain post-bootstrap is enough:\nchat error -> dispatch -> confirmed -> skip corroboration -> profile deleted.\nThe bootstrap queue makes it worse, holding the transient signal and replaying\nit as definitive at exactly the moment corroboration would have said "token\npresent".\n\nFix, keeping the socket path untouched:\n\n - the chat-error dispatch carries `reason: 'unconfirmed'`;\n - `onSocketExpired` honours `detail.reason`, defaulting to `confirmed` —\n `socketService` sends no reason, so an explicit backend push is unchanged;\n - the bootstrap replay states `reason: 'confirmed'` explicitly rather than\n leaning on that default, so it stays correct if the default is tightened.\n\nA genuine expiry still corroborates and signs out. Only the false positive is\nfiltered.\n\nCoverage, in two halves, because one test cannot see both:\n\n - `ChatRuntimeProvider.test.tsx` asserts the dispatched event carries\n `reason: 'unconfirmed'` — pinned at the dispatch, where the value is\n decided;\n - `CoreStateProvider.test.tsx` fires the event with the token still present\n and asserts `logout` is NOT called, plus a positive control firing the same\n event with the token gone that asserts it IS.\n\nRevert-checked. Reverting the dispatch alone fails only the ChatRuntimeProvider\nassertion (4ms); reverting `onSocketExpired` to a hardcoded `confirmed` fails\nonly the CoreStateProvider test. An earlier version of the CoreStateProvider\ntest constructed the event itself and so passed against the reverted dispatch —\nvacuous, and the reason the assertion now also lives at the dispatch site.\n
M3gA-Mind committed 3 months ago
739ad7d
chore: apply prettier auto-fixes
shanu committed 3 months ago
c8847c8
chore: apply prettier auto-fixes\n
shanu committed 3 months ago
520606a