t3code icon indicating copy to clipboard operation
t3code copied to clipboard

feat: add Hermes-powered T3 Work

Open maria-rcks opened this issue 4 months ago • 4 comments

Stack

This is a cross-fork draft stacked directly on #4400 (codex/v1-v2-state-migration). Its parent is the current #4400 head, 80082809973557d1cec7f7107932a4db1d37f0e7.

Summary

  • Add Hermes as a first-class orchestration-v2 provider with managed local serve startup, attachment to compatible running instances, reconnect/reconciliation, durable bindings, model/reasoning selection, command support, tool-call visibility, and provider error terminalization.
  • Add the projectless T3 Work experience across web and mobile: dedicated workspace switching, fresh-context chats, unsettled/settled/pinned thread handling, Main, clear/delete history, replies, commands, settings, and non-git behavior.
  • Add transport onboarding/import for recent Discord/Telegram/etc. sessions with an age control, canonical Work-project ownership, lazy durable history hydration, settlement classification, and profile-scoped reset/re-import.
  • Add image/video/PDF/file uploads and rendering, imported Hermes cache media, MEDIA: output handling, reply normalization, and safe durable asset access.
  • Expose T3 orchestration MCP to Hermes through authenticated, capability-scoped, lifecycle-revoked per-session leases so Hermes can delegate coding tasks to selected providers/models when the gateway advertises session_mcp.
  • Add Hermes cron/proactive infrastructure and settings, Hermes ACP support for Code mode, and a disabled OpenClaw “Soon” gateway entry.
  • Add a pinned Hermes conformance harness, sanitized protocol fixture, evidence template, and integration documentation.

Reliability and security

  • T3 Work runs do not request Git filesystem checkpoints, preventing non-git chats from hanging in checkpoint baseline capture.
  • Permanent provider-start failures terminalize instead of leaving threads stuck in Working.
  • Import and full-history reset resolve the canonical Work project server-side, validate provider/profile ownership, preserve unrelated threads, and reject reset while mutations are unsettled.
  • Import is disabled unless configured and requires an evidence-backed negotiated profile.import + session.lifecycle capability inventory; legacy gateways are not granted synthetic optional/mutating capabilities.
  • MEDIA: ingestion is confined to canonical Hermes-owned cache roots by default. Additional roots require explicit operator configuration; traversal and symlink escapes are rejected.
  • MCP credentials are hashed, audience/capability checked, atomically rotated, and revoked with their thread/session lifecycle without breaking long-running sessions via wall-clock expiry.
  • A forward migration repairs development databases that ran the earlier unscoped Hermes import ledger.

Verification

  • 67 changed test files passed, 746 tests total.
  • Typechecks passed for @t3tools/contracts, @t3tools/shared, @t3tools/client-runtime, t3, @t3tools/web, @t3tools/mobile, and @t3tools/scripts.
  • Targeted lint, formatting, git diff --check, and the staged commit hook passed.
  • Release review included adversarial coverage for cross-profile/provider reset isolation, forged project IDs, unsettled mutations, media traversal/symlink escape, long-lived MCP sessions, and multi-environment mobile routing.

Browser/dev-server/simulator testing was intentionally not run for this handoff. CodeRabbit CLI was installed but signed out, so its external review was unavailable; the branch received independent Sol-medium backend, client, security, and integration reviews instead.

Current protocol constraints

  • T3 orchestration MCP delegation is enabled only when the connected Hermes gateway advertises safe ephemeral session_mcp lease support; the pinned legacy gateway remains correctly reported as blocked rather than receiving unsafe fallback behavior.
  • Remote Hermes endpoints remain subject to the connection-security policy and explicit authentication configuration.
  • OpenClaw is visible but intentionally disabled as “Soon”; this PR includes the provider skeleton, not a production-enabled gateway.

UI Changes — Screenshots & demos

All media below is from live end-to-end runs against a real Hermes gateway (Codex OAuth, GPT‑5.5), through both T3 Work and T3 Code.

Demo videos

Full e2e pass — Hermes code work, attachments (image/PDF/file/video), MEDIA output, delegation:

Hermes e2e demo

Reload dedupe + attachment-only rendering verification (fresh and older Hermes Code threads render each message exactly once after hard reload):

Dedupe and attachment rendering demo

Hermes in T3 Work

Image upload in a Work thread — Hermes describes the attached gradient:

Work thread with image attachment

Hermes generates an image via its terminal tool; the MEDIA: output renders as an image bubble:

MEDIA output rendered

Subagent delegation — spawn acknowledged once, then the result reported back:

Delegation spawn

Delegation answer

Hermes tool inventory surfaced natively (delegate_task, cronjob, skill_manage, project tools, …):

Tool inventory

Hermes model picker (provider models incl. Codex OAuth) with the "Delegated tasks" panel:

Model picker and delegated tasks

Session import

Imported thread keeps its historical timestamp (6:47 AM) and settled state Imported threads keep historical sidebar ages, not "now"
Imported thread history Historical sidebar ages

Hermes in T3 Code

Hermes as a coding provider on a normal Code project — native Updated greet.py file-change activity, thread classified into the Code sidebar:

Hermes in Code tab

[!NOTE]

Add Hermes-powered T3 Work workspace with session import, cron, skills, and ACP driver support

  • Introduces a T3 Work workspace mode alongside T3 Code in web and mobile sidebars, filtering threads by provider driver kind (Hermes vs others) and routing new conversations to a Hermes-backed project.
  • Adds the hermes provider driver (HermesDriver.ts), hermesAcp ACP driver (HermesAcpDriver.ts), and openclaw ACP driver (OpenClawDriver.ts) to the built-in driver registry.
  • Adds a HermesServeAdapterV2 and HermesAcpAdapterV2 orchestration adapter with full session/thread/turn lifecycle, MCP lease handling, and media persistence against a Hermes gateway (HermesServeAdapterV2.ts).
  • Implements Hermes session import (discovery, import, history reset), cron management, and skills browsing via new WebSocket RPCs and corresponding settings pages (HermesSessionImportService.ts, HermesCronSettings.tsx, HermesSkillsSettings.tsx).
  • Adds chat composer support for file, PDF, and video attachments with provider-aware validation, inline video rendering, and updated markdown media rendering (ChatComposer.tsx, MarkdownMedia.tsx).
  • Adds six new SQLite migrations (44–49) for Hermes session bindings, mutation intents, session imports, proactive events, and title/branch lineage.
  • Introduces HermesConnectionSecurity for endpoint classification and HermesServeRuntime to attach to or launch a local Hermes gateway process (HermesConnectionSecurity.ts, HermesServeRuntime.ts).
  • Risk: new migrations are irreversible; enabling the Hermes provider also sets the enableHermes rollout flag and creates a T3 Work backing project automatically on first use.

Macroscope summarized f024045.


[!NOTE] Medium Risk Work launches depend on correct Hermes/t3-work routing and prepareWorkspace: false propagating through mobile outbox and turn bootstrap; server asset and Hermes remote/cron paths add security-sensitive surface area but include explicit fail-closed checks and tests.

Overview Mobile gains a persisted T3 Work / T3 Code workspace switch in the home header, sidebar, and split layouts. Lists and pending outbox items are filtered by provider driver (Hermes vs coding providers) via new mobileWorkspace helpers; Work mode forces thread-list v2, shows an Inbox header, and hides project filters.

Starting a task in Work resolves a Hermes backing project and model through resolveHermesConversationTarget, opens a New conversation draft with preselected Hermes model, uses work-scoped composer drafts, and sends prepareWorkspace: false through the outbox and thread.turn.start bootstrap so routing-only projects do not run workspace prep. Code keeps the existing new-task flow. Hermes and OpenClaw provider icons are added to the thread list.

Server changes in this diff extend signed asset URLs to workspace videos and browser artifacts (safe filenames, O_NOFOLLOW streaming), broaden attachment filename extensions, and add t3WorkDir / browserArtifactsDir derived paths. Hermes connection security assesses loopback vs remote endpoints (pairing token, TLS fingerprint, kill switches) and blocks unsupported remote verification. Hermes cron projects gateway capability inventory into list/mutate APIs with shared clients, operation-id deduplication, and execution provenance/deduping.

Reviewed by Cursor Bugbot for commit f024045b1a181b231f3e994838016a9b5e570b08. Bugbot is set up for automated code reviews on this repo. Configure here.

maria-rcks avatar Jul 27 '26 01:07 maria-rcks

[!IMPORTANT]

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b33c0a0-f987-409f-a66a-2f06feb8bd0e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • [ ] 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot] avatar Jul 27 '26 01:07 coderabbitai[bot]

Approvability

Verdict: Needs human review

1 blocking correctness issue found. Diff is too large for automated approval analysis. A human reviewer should evaluate this PR.

You can customize Macroscope's approvability policy. Learn more.

macroscopeapp[bot] avatar Jul 27 '26 03:07 macroscopeapp[bot]

I'm watching this and #4678 with attention and expectation. One unsure topic on both PRs is if either supports remote Hermes, which as become a very common Hermes setup nowadays.

fleps avatar Jul 29 '26 02:07 fleps

pls ts needs to merge. we need a hermes integration!

017pixel avatar Jul 31 '26 09:07 017pixel