Skip to content

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

refactor(chatWire): update type documentation for open JSON fields

Steven Enamakel6631bc417cf7
diff --git a/app/src/services/chatWire.ts b/app/src/services/chatWire.ts
index c457cd68b2..29421c1c52 100644
--- a/app/src/services/chatWire.ts
+++ b/app/src/services/chatWire.ts
@@ -11,9 +11,10 @@
* (`skip_serializing_if`), so `null` never arrives; consumers read absence.
* - fields the core always sets for an event are made required (see each alias).
*
- * The only hand-written shapes are the typed views of fields the schema leaves
- * as open JSON (`goal`, `todos`, `copy_params`, `citations`, tool `args`). Each
- * is marked "open JSON in the schema" below.
+ * Owner-defined records and enum values are imported from the generated thread
+ * schema. Hand-written types below are consumer projections of open event JSON
+ * or flattened host events; their validation/transformations are documented at
+ * the projection boundary.
*/
import type { ChatErrorCopyParams } from '../lib/chatErrorCopy';
import type {
diff --git a/crates/openhuman-core/src/threads/wire_schema_tests.rs b/crates/openhuman-core/src/threads/wire_schema_tests.rs
index 1d16fb86e0..07ce942e80 100644
--- a/crates/openhuman-core/src/threads/wire_schema_tests.rs
+++ b/crates/openhuman-core/src/threads/wire_schema_tests.rs
@@ -103,7 +103,7 @@ fn thread_wire_schema_exports_the_core_and_session_records() {
"citation schema is missing {field}: {citation_schema}"
);
}
- let ack = &schema["$defs"]["QueuedChatAck"];
+ let ack = resolve_schema(&schema, &properties["queuedChatAck"]);
for field in [
"queued",
"queue_mode",
@@ -125,7 +125,7 @@ fn started_chat_ack_schema_requires_every_serialized_field() {
let schema: serde_json::Value =
serde_json::from_str(&thread_wire_schema_json().expect("schema serializes"))
.expect("schema is JSON");
- let ack = &schema["$defs"]["StartedChatAck"];
+ let ack = resolve_schema(&schema, &properties["startedChatAck"]);
for field in ["accepted", "client_id", "thread_id", "request_id"] {
assert!(
ack["required"].as_array().unwrap().contains(&field.into()),