fix: settle puzzle failures and profile tasks

This commit is contained in:
kdletters
2026-05-26 22:02:58 +08:00
parent 4001ee0a5c
commit 17a184b0a7
14 changed files with 436 additions and 81 deletions

View File

@@ -167,6 +167,36 @@ impl SpacetimeClient {
.await
}
pub async fn mark_puzzle_draft_generation_failed(
&self,
input: PuzzleDraftCompileFailureRecordInput,
) -> Result<PuzzleAgentSessionRecord, SpacetimeClientError> {
let procedure_input = PuzzleDraftCompileFailureInput {
session_id: input.session_id,
owner_user_id: input.owner_user_id,
error_message: input.error_message,
failed_at_micros: input.failed_at_micros,
};
self.call_after_connect(
"mark_puzzle_draft_generation_failed",
move |connection, sender| {
connection
.procedures()
.mark_puzzle_draft_generation_failed_then(
procedure_input,
move |_, result| {
let mapped = result
.map_err(SpacetimeClientError::from_sdk_error)
.and_then(map_puzzle_agent_session_procedure_result);
send_once(&sender, mapped);
},
);
},
)
.await
}
pub async fn save_puzzle_generated_images(
&self,
input: PuzzleGeneratedImagesSaveRecordInput,