Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/api/02-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ task_id uuid-xxx
| `errors` | array | List of errors encountered during processing |
| `warnings` | array | Optional warnings, including partial processing or memory-linking failures |
| `queue_status` | object | Queue summary when waiting synchronously or reading a completed task result; grouped by queue with `processed`, `requeue_count`, `error_count`, and `errors` |
| `memory_linking` | object | Optional result of linking the resource URI to memories generated from `reason` |
| `memory_linking` | object | Optional result of linking the resource URI to memories generated from `reason`. `status="accepted"` means the memory commit is queued, not finished: poll `commit_task_id` via `/api/v1/tasks/{task_id}` for its result |

**Completed add-resource task result**

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/api/02-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ task_id uuid-xxx
| `errors` | array | 处理过程中的错误列表 |
| `warnings` | array | 可选警告,包括部分处理失败或资源记忆关联失败 |
| `queue_status` | object | 同步等待或已完成任务结果中的队列汇总,按队列返回 `processed`、`requeue_count`、`error_count` 和 `errors` |
| `memory_linking` | object | (可选,仅当 `reason` 触发记忆生成时)本次资源 URI 与用户记忆的关联结果 |
| `memory_linking` | object | (可选,仅当 `reason` 触发记忆生成时)本次资源 URI 与用户记忆的关联结果。`status="accepted"` 表示记忆提交已入队、尚未完成,需轮询 `/api/v1/tasks/{task_id}`(`commit_task_id`)获取结果 |

**完成后的资源添加任务结果**

Expand Down
10 changes: 6 additions & 4 deletions openviking/service/resource_memory_link_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,11 @@ async def on_resource_added(
) -> Dict[str, Any]:
"""Queue add-resource reason extraction as a normal session commit.

Returns once the commit is queued. Every reason commit serializes on one
shared session, so waiting for it here held the caller behind all earlier
reason commits (one stalled commit could block resource ingestion).
Returns ``status="accepted"`` once the commit is queued; poll
``commit_task_id`` through the Task API for its result. Every reason commit
serializes on one shared session, so waiting for it here held the caller
behind all earlier reason commits (one stalled commit could block resource
ingestion).
"""
reason = (reason or "").strip()
if not reason:
Expand Down Expand Up @@ -209,7 +211,7 @@ async def on_resource_added(
)

return {
"status": "success",
"status": "accepted",
"session_id": session_id,
"commit_task_id": commit_result.get("task_id"),
"archive_uri": commit_result.get("archive_uri"),
Expand Down
6 changes: 3 additions & 3 deletions tests/service/test_resource_memory_link_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ async def test_on_resource_added_bridges_reason_through_fixed_session(request_co
)

session_id = result["session_id"]
assert result["status"] == "success"
assert result["status"] == "accepted"
assert session_id == _RESOURCE_REASON_SESSION_ID
assert session_service.got == [
{
Expand Down Expand Up @@ -285,7 +285,7 @@ async def wait(self, *args, **kwargs):
timeout=3,
)

assert result["status"] == "success"
assert result["status"] == "accepted"
assert result["commit_task_id"] == "reason-task"


Expand Down Expand Up @@ -338,7 +338,7 @@ async def add_from_other_queue():
release.set()
results = await asyncio.wait_for(asyncio.gather(first, second, worker), timeout=3)

assert all(result["status"] == "success" for result in results)
assert all(result["status"] == "accepted" for result in results)
assert all(result["session_id"] == _RESOURCE_REASON_SESSION_ID for result in results)
assert [call["session_id"] for call in session_service.committed] == [
_RESOURCE_REASON_SESSION_ID
Expand Down
Loading