-
Notifications
You must be signed in to change notification settings - Fork 461
feat: add table for session inbound events #805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
88103c5
f54105b
0efbc39
0a7e0c1
78506cf
60cce4f
6e5ccea
d611bfb
27a53ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@truefoundry/trueforge-core": patch | ||
| "@truefoundry/trueforge": patch | ||
| --- | ||
|
|
||
| Add `session_inbound_events` store API for durable tip HITL send-event inbox (insert / list unconsumed / mark consumed), with Postgres and SQLite migrations. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /** | ||
| * Inbound send-event payloads for tip HITL (client → harness), distinct from the | ||
| * stream log ({@link PersistedTurnEvent} / session_event). | ||
| * | ||
| * Public send is session-scoped (`POST …/sessions/{id}/events`) with required | ||
| * body `turn_id` (one batch → one tip) plus `SessionInboundEventItem`s; rows stamp that | ||
| * tip id. v1 union is tip-only; approval policies may relax `turn_id` later. | ||
| * `user.message` stays on createTurn / steer. | ||
| */ | ||
| import { z } from '@hono/zod-openapi'; | ||
| import { UserToolApprovalMessageSchema, UserToolResponseMessageSchema } from '../../core/events/schema'; | ||
|
|
||
| export const SessionInboundEventItemSchema = z | ||
| .discriminatedUnion('type', [UserToolApprovalMessageSchema, UserToolResponseMessageSchema]) | ||
| .openapi('SessionInboundEventItem'); | ||
|
|
||
| export type SessionInboundEventItem = z.infer<typeof SessionInboundEventItemSchema>; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,6 +74,18 @@ export class TurnAlreadyExistsError extends SessionStoreConflictError { | |
| } | ||
| } | ||
|
|
||
| export class SessionInboundEventAlreadyExistsError extends SessionStoreConflictError { | ||
| readonly session_id: string; | ||
| readonly event_id: string; | ||
|
|
||
| constructor(session_id: string, event_id: string, options?: ErrorOptions) { | ||
| super(`Session inbound event already exists: ${session_id}/${event_id}`, options); | ||
| this.name = 'SessionInboundEventAlreadyExistsError'; | ||
| this.session_id = session_id; | ||
| this.event_id = event_id; | ||
| } | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error constructor takes two stringsLow Severity
Triggered by project rule: TrueForge review rules Reviewed by Cursor Bugbot for commit 6e5ccea. Configure here. |
||
|
|
||
| export class PreviousTurnRunningError extends SessionStoreConflictError { | ||
| readonly previous_turn_id: string; | ||
|
|
||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.