Replace what a task depends on
tasks.task.set_dependencies
POST/api/v1/households/{household_id}/commands/tasks.task.set_dependencies
- Command
- Rigel runs it
- Applies offline
Sets exactly which tasks must be done before this one can start. A task waiting on an unfinished one is blocked whatever its state says. Fails with task_not_found or dependency_cycle (it would end up waiting on itself).
Parameters#
| Field | Description |
|---|---|
household_idpathstringrequired | The household's ID. |
Idempotency-Keyheaderstringoptional | The command's ID. Reuse it when retrying the same command. |
Request body#
JSON, as application/json.
| Field | Description |
|---|---|
task_idstringrequired | A task ID, such as tsk_01JC0000000000000000000000. |
depends_on_task_idsarray of stringsrequired | Every task that must be done before this one. Empty clears them. |
Response#
200 The command was applied.
| Field | Description |
|---|---|
resultobjectrequired | What the command returned, such as the IDs it created. |
versionintegerrequired | The household version after the command. |
Errors#
Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.
| Status | Code | When |
|---|---|---|
400 | validation_failed | A field is missing, misspelled or out of range. details.fields lists each problem. |
401 | unauthenticated | The request has no valid session. |
404 | task_not_found |
|
404 | not_found | The household doesn't exist, or you aren't a member of it. |
409 | dependency_cycle |
|
409 | idempotency_key_reused | The Idempotency-Key was already used for a different command. |
Examples#
These are real. Each scenario is one of the command's test cases, run on a household when this site was built, and the response is what the API returned.
Adds dependencies, once each
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000B",
"tsk_01JC000000000000000000000C",
"tsk_01JC000000000000000000000B"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01JC000000000000000000000A",
depends_on_task_ids: [
"tsk_01JC000000000000000000000B",
"tsk_01JC000000000000000000000C",
"tsk_01JC000000000000000000000B",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000B",
"tsk_01JC000000000000000000000C",
"tsk_01JC000000000000000000000B"
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0MS4Q2RZT9W2P2V9M
{
"result": {},
"version": 1
}Replaces the set: unwanted go, wanted stay, new are added
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000C",
"tsk_01JC000000000000000000000D"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01JC000000000000000000000A",
depends_on_task_ids: [
"tsk_01JC000000000000000000000C",
"tsk_01JC000000000000000000000D",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000C",
"tsk_01JC000000000000000000000D"
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0H6KG8Z21QF8T7BKS
{
"result": {},
"version": 1
}An empty list clears them
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": []
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01JC000000000000000000000A",
depends_on_task_ids: [],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": []
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R06SNQES01V0NJ23FS
{
"result": {},
"version": 1
}The same set again changes nothing
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000B"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01JC000000000000000000000A",
depends_on_task_ids: [
"tsk_01JC000000000000000000000B",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000B"
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0KBP268RMCQX1Q789
{
"result": {},
"version": 1
}Two paths to the same task is not a cycle
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000B",
"tsk_01JC000000000000000000000C"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01JC000000000000000000000A",
depends_on_task_ids: [
"tsk_01JC000000000000000000000B",
"tsk_01JC000000000000000000000C",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000B",
"tsk_01JC000000000000000000000C"
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0JGYGQGRHH9D1K7D0
{
"result": {},
"version": 1
}On itself
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000A"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01JC000000000000000000000A",
depends_on_task_ids: [
"tsk_01JC000000000000000000000A",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000A"
]
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R06J39C35DNBY9GNX3
{
"error": {
"code": "dependency_cycle",
"message": "A task can't wait on itself, even through other tasks. No changes were applied.",
"details": {
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_id": "tsk_01JC000000000000000000000A"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R06J39C35DNBY9GNX3"
}
}On a task that depends on it
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000B"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01JC000000000000000000000A",
depends_on_task_ids: [
"tsk_01JC000000000000000000000B",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000B"
]
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0KXYRKH743BAKR7WJ
{
"error": {
"code": "dependency_cycle",
"message": "A task can't wait on itself, even through other tasks. No changes were applied.",
"details": {
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_id": "tsk_01JC000000000000000000000B"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0KXYRKH743BAKR7WJ"
}
}On a task that depends on it through others
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000D"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01JC000000000000000000000A",
depends_on_task_ids: [
"tsk_01JC000000000000000000000D",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000D"
]
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R01RA9N2WX7RZBRHXS
{
"error": {
"code": "dependency_cycle",
"message": "A task can't wait on itself, even through other tasks. No changes were applied.",
"details": {
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_id": "tsk_01JC000000000000000000000D"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R01RA9N2WX7RZBRHXS"
}
}A missing dependency
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000Z"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01JC000000000000000000000A",
depends_on_task_ids: [
"tsk_01JC000000000000000000000Z",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"task_id": "tsk_01JC000000000000000000000A",
"depends_on_task_ids": [
"tsk_01JC000000000000000000000Z"
]
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0WX7H6ZP3B87AVJF1
{
"error": {
"code": "task_not_found",
"message": "That task isn't there any more. No changes were applied.",
"details": {
"task_id": "tsk_01JC000000000000000000000Z",
"field": "depends_on_task_ids"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0WX7H6ZP3B87AVJF1"
}
}A missing task
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"task_id": "tsk_01JC000000000000000000000Z",
"depends_on_task_ids": []
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01JC000000000000000000000Z",
depends_on_task_ids: [],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"task_id": "tsk_01JC000000000000000000000Z",
"depends_on_task_ids": []
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0BAQMDS4CEGD9CJJT
{
"error": {
"code": "task_not_found",
"message": "That task isn't there any more. No changes were applied.",
"details": {
"task_id": "tsk_01JC000000000000000000000Z"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0BAQMDS4CEGD9CJJT"
}
}Say what must be done first
Replaces the list. Rigel refuses a list that would make a task wait on itself.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CT3H63ZZ48MHJFVTDP1R' \
-d '{
"task_id": "tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF",
"depends_on_task_ids": [
"tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
"tsk_01M6V9CT2ZK0Q2GZQQNSQY33QB"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CT3H63ZZ48MHJFVTDP1R",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF",
depends_on_task_ids: [
"tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
"tsk_01M6V9CT2ZK0Q2GZQQNSQY33QB",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CT3H63ZZ48MHJFVTDP1R
{
"task_id": "tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF",
"depends_on_task_ids": [
"tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
"tsk_01M6V9CT2ZK0Q2GZQQNSQY33QB"
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CT3HXE7K7AX92JH0WJYK
{
"result": {},
"version": 238
}Make a task wait on its own follow-up
Assembling needs the shelves ordered, so ordering can't also wait on assembling.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CT3JPR2XPKWVKQRREYMH' \
-d '{
"task_id": "tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
"depends_on_task_ids": [
"tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF"
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CT3JPR2XPKWVKQRREYMH",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
task_id: "tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
depends_on_task_ids: [
"tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF",
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CT3JPR2XPKWVKQRREYMH
{
"task_id": "tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
"depends_on_task_ids": [
"tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF"
]
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01M6V9CT3JP0FS1KQN1N35Y4Y6
{
"error": {
"code": "dependency_cycle",
"message": "A task can't wait on itself, even through other tasks. No changes were applied.",
"details": {
"task_id": "tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
"depends_on_task_id": "tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01M6V9CT3JP0FS1KQN1N35Y4Y6"
}
}For Rigel#
Rigel's tool for this command is tasks_task_set_dependencies. Rigel runs this on its own, then says what it did. The agent guide has the rest.