Roasea reference integration
Embed Rungent as Roasea's only agent loop.
Roasea uses embedded mode because tools need direct access to SQLAlchemy and map services. The migration boundary is small:
- Convert functions in
api/services/llm/tools.pyto typed@tooldefinitions. - Move the planner prompt into one
Agent. - Convert
build_snapshot()into the Agent context provider. - Mount the Rungent FastAPI router under
/api/assistant. - Create sessions with
resource={"trip_id": trip_id}. - Replace browser-provided history with Rungent-owned sessions.
- Use
@rungent/sdkinchat-panel.tsxand revalidate Trip SWR state afterrun.completed. - Add the matrix from Agent baseline testing.
remove_place and remove_day should require approval. Moving, swapping, renaming, and changing
transport may execute directly because the UI already makes those changes reversible.
Match tool granularity to the user's business action. “Change every leg to driving” should call one Roasea-owned batch tool that updates all valid legs in one transaction. It should not make the model resolve every place and issue repeated single-stop writes, and Rungent's bounded-loop limit should not be raised to compensate for such an undersized interface.
Rungent transports and persists final assistant content as an opaque string. Roasea defines the
Agent's Markdown writing rules and renders only assistant output with its own sanitized, streaming
Markdown component; user-authored content remains plain text. Formatting, link policy, and visual
styling stay outside Rungent and @rungent/sdk.
See the scaffold in examples/roasea/ in the repository.
Importing externally generated itineraries
Treat a long import as one staged business operation, not a sequence of add_place calls:
- The product Agent denoises the latest user-corrected itinerary into a typed candidate.
prepare_itinerary_importresolves places and persists an application-owned draft. It returns a structured diff throughToolResult.publicwithout changing the trip.- The Agent uses
request_inputfor unresolved places, dates, and merge conflicts, then refreshes the draft with another application tool. - One
approval="always"commit tool freezes the draft ID and expected trip revision. The host checks that revision and applies the whole diff in one database transaction.
Rungent owns the durable clarification and approval lifecycle. Roasea owns import drafts, domain validation, place providers, optimistic concurrency, the diff UI, and the transaction.