feat(graphql): add sessions.active query and fix chat service binding#210
Open
feat(graphql): add sessions.active query and fix chat service binding#210
Conversation
Create a new moltis-web crate that owns all browser-facing concerns: - Rust modules: assets serving, HTML templates, route composition, terminal proxy - Static assets (JS, CSS, icons, HTML) moved from gateway/src/assets - Askama templates moved from gateway/src/templates - Playwright E2E tests and Tailwind build tooling moved from gateway/ui The web crate injects its routes into the gateway via a RouteEnhancer composition pattern, keeping UI concerns separate from API/agent logic. Auth gate is applied globally in finalize_gateway_app rather than per-route. The web-ui feature flag in moltis-cli controls inclusion. Update all cross-references in CI workflows, docs, scripts, justfile, biome.json, and CLAUDE.md. Add streaming.md section for the new web crate layer in the data flow.
Replace two separate identity fields (creature, vibe) with a single
theme field across the entire codebase. Existing IDENTITY.md files
with creature or vibe keys are accepted as backward-compat aliases
in the frontmatter parser; new saves always write theme.
System prompt changes from two sentences ("You are a {creature}." +
"Your vibe: {vibe}.") to one ("Your theme: {theme}.").
Onboarding wizard merges two steps (AgentCreature, AgentVibe) into
one (AgentTheme). UI replaces two input fields with a single Theme
input in both onboarding and settings pages.
Move 20 service trait definitions and their simple Noop implementations from gateway/services.rs into a dedicated moltis-service-traits crate. This breaks the circular dependency where implementations had to live in gateway just to access trait definitions. The gateway re-exports everything from service-traits for backwards compatibility. Gateway-specific code (NoopSkillsService with complex deps, RealBrowserService, GatewayServices struct, helper functions) stays in gateway.
…ase 1) Move tls.rs (657 lines) to moltis-tls and tailscale.rs (548 lines) to moltis-tailscale. Both modules had zero crate:: imports, making them trivial extractions. Gateway retains thin re-export modules for backwards compatibility. The tls and tailscale feature flags now gate the new crate dependencies.
Move credential store, WebAuthn, and locality detection into dedicated moltis-auth crate. Gateway auth.rs and auth_webauthn.rs become thin re-exports. Removes argon2, password-hash, webauthn-rs-proto, and openssl as direct gateway dependencies (now transitive via moltis-auth). Locality tests (37 total) now live in moltis-auth; gateway test count unchanged at 49.
Move provider setup logic (4,180 lines) into a dedicated crate. Introduces SetupBroadcaster trait and ErrorParser callback to decouple from gateway's broadcast mechanism and chat_error module. Gateway's provider_setup.rs becomes a thin re-export plus GatewayBroadcaster impl. local-llm feature forwarded to the new crate. 70 tests now live in moltis-provider-setup.
Port GraphQL improvements from ethiebaut/graphQL branch onto current main: - Add sessions.active query to check whether an LLM run is active - Fix chat methods to use late-bound state.chat() instead of s.chat, ensuring GraphQL shares the same LiveChatService as WebSocket/RPC - Fix SessionEntry.id type from i64 to String to match RPC data - Accept "message" as alias for "text" param in chat.send - Add "ok": true to send/delete responses for consistency
Contributor
Merging this PR will improve performance by 44.42%
Performance Changes
Comparing Footnotes
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ethiebaut/graphQLonto currentmain(post crate-extraction refactors)sessions.activeGraphQL query to check whether a session has an active LLM runstate.chat()instead ofs.chat, ensuring GraphQL shares the sameLiveChatServiceinstance as WebSocket/RPC callersSessionEntry.idtype fromi64toStringto match actual RPC data"message"as alias for"text"param inchat.send"ok": trueto send/delete responses for consistencyValidation
Completed
cargo checkpassesAgentIdentityfield change (theme→creature+vibe) since main consolidated in the opposite directionRemaining
cargo +nightly-2025-11-30 fmt --all -- --checkcargo +nightly-2025-11-30 clippy -Z unstable-options --workspace --all-features --all-targets --timings -- -D warningscargo test./scripts/local-validate.shManual QA
/graphql{ sessions { active(sessionKey: "test") { active } } }— should return{ "active": false }sessions.active— should returntruewhile LLM is responding