Inbox and approvals
Last updated November 4, 2026
On this page
- What lands in your inbox
- Unread and Everything
- Marking items read
- Waiting on you and Waiting on others
- The approval card
- Who may decide
- What happens when you approve
- What happens when you reject
- Expiry
- Questions a run waits on
- Try it in the demo: refuse, then approve the refund
- Ask for the refund
- See a wrong person refused
- Refuse it
- Approve it
- Confirm the run resumed
- The email approval: one click, and who else may decide
- Not possible yet
- For developers
- API
- Events
- CLI
Your inbox is where OrchKernel tells you about work that involves you: an agent that needs your approval, a question a run is waiting on, a mention in a thread, a task handed to you. An approval is the moment a person decides whether an agent may go ahead with something the company's policy holds for a person, such as a refund over the cap or an email to a customer. Until someone decides, the agent's run (one attempt by an agent at a task, with its steps; see Asking an agent) is parked: it stops and waits.
What is not possible yet is listed at the end.
What lands in your inbox#
| Item | Shown as | When you get it | Clicking it opens |
|---|---|---|---|
| Approval | Churn-risk watcher needs approval: Issue a refund or credit | An agent's action waits for you. | The thread it was asked in, else the run; an approval with neither opens Governance › Approvals |
| Question | Support Agent asks: Which invoice should I look at? | A run is parked until you answer. | Answered in place, from its card under Waiting on you; Open in thread opens the thread at the question (see Questions) |
| Mention | mentioned in thread: @tom can you check the Northwind ticket?, from the person who mentioned you | Someone @ mentioned you in a thread. |
The thread |
| Update | Completed '...', Failed '...', Stopped at ..., Declined '...', Ada Park added you to '...' as observer | A run you started finished, stopped or was refused, a thread owner added or removed you, a new artifact version in your thread, and other notes from OrchKernel. | |
| Ask to several agents | Combined answer ready: ..., SEO Analyst and Analytics Analyst answered: ..., 1 of 2 agents answered: ..., No agent could answer: ..., Pat Kim stopped your ask: ... | Your ask to several agents ended (one item for the whole ask, not one per agent), or someone else stopped it. See Asking several agents together. | |
| Model needed | Sam Ortiz needs a model for customers' personal details so Sales Assistant can answer · Fix this (admins); Sales Assistant can now answer · Try again; Ada Park chose not to allow this: ... | Someone pressed Ask an admin on a run no model could take; then a model was cleared for it, or an admin kept things as they are. See When no model may take the data. | Models at the clearance it needs (the admin's item); the run |
| Repeat | Your repeat Marketing weekly review is paused: ..., Marketing weekly review needs your attention: ... | One of your repeats paused, skipped or needs you. See Repeats. | The thread the run worked in, else the run (in a panel over the inbox). A note about knowledge opens Governance › Knowledge, a flagged record its collection under Brain, an approval the policy now refuses Governance › Approvals, an audit finding Governance › Audit. "Removed you from ..." opens nothing. |
| Task | Task: ... | A task was assigned to you or to your team. | Work, with the task open |
| Escalation | Escalated: ... (SLA breached), with a red escalation badge | A task you are responsible for passed its deadline. | Work, with the task open |
| Review | Schema proposal on ..., Steward proposes on ... | A schema change waits for your review. | Governance › Schema |
| Change proposed | Change proposed: ..., with a review badge | A skill, agent, playbook or policy change waits for your review. | Governance › Changes |
| Knowledge review | Knowledge awaiting review (...), Knowledge ... conflicts with an accepted entry | Shared knowledge waits for a reviewer, or contests an accepted entry. | Governance › Knowledge |
| Delegation | Pat Kim delegated to you: ... | Someone delegated authority to you. See Delegations. | Governance › Delegations |
| Agents | Eli Novak made a Sales Assistant for you. Turn it on?, Alice Chen asks for her own copy of Inbound Sales Assistant, Inbound Sales Assistant no longer works for you (Eli Novak, 9 Oct), Sam Ortiz set Your follow-ups today for Sales with Sales Assistant, Sam Ortiz asks you to set your time zone, ... | An agent was made for you, someone asks for their own agent and you may decide it, an agent stopped working for you, a team schedule is offered to you, or someone asks you to set your time zone. See Your own agents, Manage agents, Team schedules. | My agents, or your Profile |
| Grant | You manage agents for Sales | An admin granted or revoked manage agents for you. See Manage agents. | Your Profile |
Each row has an icon for its kind and, under its title, who sent it and the kind: "OrchKernel · update" for OrchKernel's own items, "Churn-risk watcher for Maya Patel · approval" for an approval, else the person or agent who sent it.
The Inbox link in the sidebar shows how many unread items you have, approvals waiting on you included.
Unread and Everything#
The Inbox page has two tabs, and a third, Drafts, once your inbox assistant is on.
- Unread (the default, with your unread count beside it) lists items you have not read yet. Approvals and questions waiting on you are not repeated in this list: they appear as full cards under Waiting on you at the top, questions first. When there is nothing, it says "Nothing here."
- Everything lists every item you ever received, read or not, newest first. Approvals appear here as one line with where they stand, for example Issue a refund or credit: approved with an Approved badge, or Issue a refund or credit: rejected with Rejected. Questions show Waiting ("waiting for Fiona Reyes") or Answered ("Fiona Reyes answered: Overwrite"), and open in their thread at the question.
- Drafts, between the two, with its count, lists only the draft replies your inbox assistant wrote for you, each as a draft card with Send, Edit and Don't send (The inbox assistant). A reply waiting on someone else under a company rule keeps its ordinary approval card for that person, and shows under Waiting on others for you.
Marking items read#
An unread item has a dot at its right. Press the dot to mark it read. An item that opens nothing (such as "removed you from a thread") is marked read when you click it.
Some items are marked read for you:
- an approval, once you decide it;
- a question, once it is answered;
- a run's update (Completed '...', Failed '...', Declined '...' and the like), once you open the thread it ended in, which says the same thing there.
Opening an item that leads somewhere (a mention, for example) does not mark it read.
Pressing the dot marks the item read at once: it leaves Unread and the Inbox count is one lower, with no reload.
Waiting on you and Waiting on others#
Above the items list, the Inbox shows pending approvals as cards:
| Section | What it holds |
|---|---|
| Waiting on you | Pending approvals you may decide, each with Approve and Reject. |
| Waiting on others | Folded, with a count; click it to open. Pending approvals you can see but someone else decides ("Approvals you can see but someone else decides."). |
An admin sees every pending approval in the company, so Ada's Waiting on others holds, for example, the follow-up email that only Alice may approve. Anyone else sees only the approvals addressed to them. An approval in your own conversation that someone else decides (such as Maya's refund, which waits for Ada) shows on the conversation, not in your inbox.
Governance › Approvals lists the same pending approvals as cards, without the other inbox items. When there are none it says "No pending approvals."
The approval card#
The same card appears in the inbox, on Governance › Approvals and in the conversation where the agent was asked. For the demo refund, as Ada sees it, it reads:
Waiting for you · Approval Issue a refund or credit Churn-risk watcher asks to issue a refund or credit of $250.00 on behalf of Maya Patel. Amount $250.00 · Invoice inv-2026-09-1042 · Reason Double charge on the September invoice (ticket T-1042) Goodwill credits by agents over the cap of 100.00 in the account currency per call need an admin, whatever the trust tier Why am I asked? You decide · See the run · 4:58 PM · Reject · Approve $250.00
| Part | What it tells you |
|---|---|
| Badge | While it waits: "Waiting for you" for whoever may decide it, else "Waiting for Ada Park". Once closed, its state: Approved, Rejected, Withdrawn (see below), and Expired for an outside agent's action. An App paused badge while its app is paused (below). |
| Title | The action by its tool's name. |
| "asks to ... of ... on behalf of ..." | Which agent asks, the amount when there is one, and the person it acts for. The "on behalf of" part is left out when the person it acts for is also the one asked: Alice's email card reads "Sales Assistant asks to send email." |
| Payload | Exactly what will run if you approve: the amount and invoice of a refund; the recipient, subject and full text of an email. Amounts are shown in the company's currency. Nothing has run yet. |
| The rule | The rule's own words for why approval is needed. |
| Why am I asked? | For whoever can decide (others see Why does this need approval?). Opens the checks as they were when the agent asked: the delegation it holds, no pause or kill switch in the way, the agent is active, the skill declares the tool, the delegation's limit, the agent, task and thread budgets, the rule that asked, and who would be asked. It ends with who the policy asks, such as "The policy asks anyone with the admin role." See How the gate decides. |
| Policy now | If the policy changed since the agent asked, a red line says so: "Policy changed since this was asked: it now asks ...", or that it would now be allowed without approval. |
| Footer | Who decides ("You decide", or "An admin (Ada Park) decides" for anyone else), See the run (opens the run's steps in a panel), and when it was asked. |
| Reject and Approve | Only for people who may decide it. For an amount the button reads Approve $250.00. |
After a decision the card says who decided and when: "Approved by Ada Park · 5:00 PM", or "Rejected by Ada Park · 4:59 PM: Billing is already refunding this by hand".
Not every approval comes from an agent. A team lead's invite into their team waits for an admin as an approval that reads "Invite Carol Diaz (carol@acme.example) as support_agent to Support"; when the company has no email set up, the card adds "Email is not set up: once approved, copy Carol's link from People and send it." See When someone who is not an admin changes a person.
Who may decide#
| Approval asks for | Who may decide it |
|---|---|
| A role (the demo refund asks for the admin role) | Anyone who holds that role, and no one else. |
| The person the agent acts for (the demo's follow-up email asks Alice) | That person, or the agent's manager: the agent's reports_to, else its team's lead (Sam for the Sales Assistant). |
| A named person, the thread or task owner, or the agent's manager | That person, or the agent's manager. |
| An outside agent's action, addressed to the person it acts for | Only that person approves; the agent's manager may only reject. |
| A side effect of an agent under an advise delegation | Only the person who delegated approves; the agent's manager may only reject. See Delegations. |
| Anything a person's own agent asks, and any reply through a tool marked as sending a message (the inbox assistant's replies), whichever agent calls it | Only the person the call acts for, who for a person's own agent is its owner. Others may only reject, with a reason the person reads, and only when the agent is not private; on a private agent they see nothing of it. See Your own agents. |
| A message sent in a person's name (the bundled Send email and Reply on a ticket tools) that a company or app rule sends to someone else: a named person, a role, the person's manager, or the agent's manager (Support operations' "the support lead approves the draft") | Those the rule names decide it; then the person it is sent for co-signs it from their own inbox before it goes ("it is sent in your name"). Tom's reply to Northwind waits for Maya, then for Tom. |
| A person's request for their own agent | Every holder of manage agents covering them, and admins; never the person asking. See Manage agents. |
| A step held in review mode: a run carrying other agents' answers, someone else's message or a third party's answer wants to change something | Only the person the work is for approves ("only Sam Ortiz approves what this run carries; others may reject it"); the agent's manager and admins may only reject. The card names what the run carried: "Content Writer wants to write to Content items. This run carried answers from Sales Assistant (Leads)." A repeat's reads "Marketing weekly review wants to write to Content items · decide by 13:00". |
Withdrawn. An approval nobody needs to decide any more is closed as Withdrawn with its reason and leaves the inbox. Offboarding a person withdraws the approvals they asked for and those of runs acting for them ("person offboarded"); offboarding an agent withdraws its runs' approvals ("agent offboarded"). A withdrawn approval no longer counts as waiting: when Tom is offboarded with a refund waiting for Ada, Maya's refund for the same invoice is not refused as a duplicate.
Only a person can decide. Being an admin is not enough on its own: Ada sees
Alice's email card but cannot approve it (the API answers 403
ada may not decide approval ...). Who is asked comes from the company's
policy, not from the thread; see Policy, rules and kill switches.
The agent's manager finds it too: an approval they may decide shows under
Waiting on you in their Inbox (GET /approvals lists it), though it is
addressed to someone else and no inbox item is sent to them. Sam sees
Alice's email card there with Approve and Reject; on an outside agent's
action, addressed to the person it acts for, the manager sees Reject only.
The agent's manager is its reports_to, else its team's lead.
Who can see an approval: admins, the agent that asked, the approver, the person the agent acts for, anyone who may decide it, and anyone who can see its run, task or thread. To anyone else it does not exist (the API answers 404).
What happens when you approve#
- A confirmation, for money. For a refund or other financial action, Approve $250.00 first shows "Issue a refund or credit of $250.00? It runs as soon as you approve." with Cancel and Approve $250.00. Other actions, such as an email, are approved with one click.
- The re-check. Before anything runs, OrchKernel checks again:
- the approval is still pending and you may decide it;
- neither the agent nor the tool is paused (a paused app counts);
- what the policy says now. If a rule now refuses the action, approving is refused and the approval stays pending so it can be rejected. If the policy now asks someone else, only that person may approve.
- The action runs. That one action is carried out, exactly as the payload shows. The toast says Approved.
- The run resumes from the next step. The agent does not start over: it carries on with the rest of its plan from where it parked. The ticket and the account it read before the approval are not read again.
- The result lands where it was asked. In the demo, Maya's
conversation shows "Refunded after an admin approved it." with the
refund id
re_3Rk0a1Lq, and Maya gets a Completed update in her inbox.
While an app is paused (see Apps), its approvals stay pending. The card shows an App paused badge, the line "CRM is paused. This waits until an admin resumes the app; then it can be approved. You can still reject it.", and, next to a grayed-out Approve, "Approve is off while CRM is paused."
What happens when you reject#
Reject opens a reason box. For a financial action the box is labeled "Reason (required)" and Confirm reject stays grayed out until you write one; otherwise the reason is optional.
- The action never runs. The toast says who hears of it: "Issue a refund or credit: rejected · Maya Patel was told".
- The run stops. In the conversation its result reads "Rejected by Ada Park · 4:59 PM: Billing is already refunding this by hand" and "What the run did before the rejection is under Details.", its Details line reads Rejected, and its task shows Cancelled (on Work › Runs the run reads Declined).
- The person the agent acted for gets an inbox update: "Declined 'Northwind wants a refund for the double charge': Ada Park rejected "Issue a refund or credit": Billing is already refunding this by hand".
A decision is final. Deciding an approval that is already decided changes nothing.
Expiry#
Approvals asked by OrchKernel's own agents do not expire: the run waits until someone decides. An outside agent's approval expires after that agent's approval time (24 hours unless an admin set another); its card shows "Expires in ..." and, afterwards, "nobody decided it in time, so the action did not run." See Outside agents.
Questions a run waits on#
When an agent needs something from a person before it can go on (a choice, a missing detail), it asks a question and the run parks. The question goes to the person the run acts for, else to whoever asked for the work (an ask, an @ mention, a task they made), even when the agent does not work for them; only work nobody asked for (a schedule, a webhook) goes to the people the agent's app acts for, or its manager or team lead. Whoever asks may send the questions elsewhere (the thread's owner, each agent's team lead, a named person) with a time and what then; see Who answers an agent's questions. It lands in their inbox ("Support Agent asks: Which invoice should I look at?") and in the run's thread. A run may ask at most three questions.
You answer where you see it:
- Inbox. Under Waiting on you, the question is a card: "Waiting for you", "Investor-Update Writer asks you" ("Investor-Update Writer, working for Ada Park, asks you" when it works for someone else, so you know whose work you are answering for), the question, a button for each suggested answer ("Overwrite", "Keep the existing draft") and a box to answer in your own words. One click on a suggested answer, or Answer after typing, answers it. The card then shows your answer, "You answered" and when, and the run carries on. Open in thread opens the thread at the question (or Open the run when it was asked outside a thread).
- Thread. The question is the same card, addressed to the person asked. Everyone else in the thread reads "Waiting for Fiona Reyes to answer" under it, then the answer, who gave it and when. The run's live line reads "Waiting for Fiona Reyes to answer" ("Waiting for Fiona Reyes or Sam Ortiz to answer" once it was escalated to Sam). For Fiona, and for Sam after the escalation, it reads "Waiting for your answer" with an Answer button that brings the card into view. People in the thread also read what the agent was asked to do ("About: ...") on the card.
- Not in the thread? You were asked in a conversation you are not part of (Ada gave the Investor-Update Writer work of its own, which nobody asked for, and its question went to Fiona, whom it works for). Open in thread then shows only the question put to you, "You are not in this conversation, so you see only what its agents asked you", not the rest of the conversation, nor what the agent was asked to do. When someone it was escalated to answers first, your card says so at once.
Answering marks the inbox item read. When the task was escalated, the person
it was escalated to may answer too; whoever answers first is recorded, and a
second answer is refused ("Fiona Reyes already answered this question:
Overwrite"). Admins may answer through the API. The answer reaches the agent
as data, never as instructions, and the question_answered event records
who answered.
When the agent gave no suggested answers, the card has the box only. Agents are prompted to offer the choices for a yes-or-no question as buttons, worded as what they will do.
The card can also show:
- "Waiting for Alice Chen until 11:00, then you": the ask's rule gave her a time; after it the question also goes to the next person, or the agent goes on with its best guess, or stops.
- "Sales Assistant wanted to ask Pat Kim. Its question may hold data Pat may not read (Leads), so it came to you. Answer it, or pass it to Pat." with Pass it to Pat: the person named may not read what the run carries, so it came to you first.
- Pass it on (anyone who may answer, up to 3 times): a sheet shows exactly what the other person will see, the question, its choices and the kinds of data its run read, before you pass it. They get only the question. Someone it was passed to can Pass it back to Sam.
- "Sam Ortiz passed it to Alice Chen", "Sam Ortiz answered for Alice Chen", and "Nobody answered in time: Analytics Analyst went on with its best assumption" once answered.
- "This question was withdrawn: …" when its run was stopped while you typed; what you had written stays under "What you had written" so you can copy it.
The demo's stub planner never asks a question; use a real model (see
Models) or an explicit plan with an ask operation (see
Asking an agent).
Try it in the demo: refuse, then approve the refund#
This uses the demo company from the Quickstart. With no model key, the demo's stub planner plans the refund; a real model plans its own steps, but the approval works the same way.
Start with a fresh demo (ok demo --force, then ok demo serve), so ticket
T-1042 has not been refunded yet. The workspace is at
http://127.0.0.1:8080 unless you started the server with another
--bind.
Ask for the refund#
- Sign in as maya (support lead). Click Threads, then Churn-risk
watcher under Talk to an agent. Type
Northwind wants a refund for the double chargeand press Send. - The conversation shows the approval card Issue a refund or credit,
Waiting for Ada Park, for $250.00 against
inv-2026-09-1042. Maya is the person the agent acts for, but there is no Approve button: the card's footer says "An admin (Ada Park) decides". The details panel (the panel icon at the right of the header) lists the approval under Approvals as Pending and the task under Tasks as Parked. - Maya's own Inbox says "Nothing here.", and Governance › Approvals says "No pending approvals.": the refund is not hers to decide.
See a wrong person refused#
The screen hides the buttons from anyone who may not decide, and the server
refuses them too. Use the API tokens ok demo serve printed for Ada and
Maya. You need the approval's id: it is the id in Ada's list of pending
approvals.
curl -H "Authorization: Bearer <ada's token>" \
http://127.0.0.1:8080/api/approvals
Then try to approve with Maya's token:
curl -X POST -H "Authorization: Bearer <maya's token>" \
-H 'content-type: application/json' -d '{"approved": true}' \
http://127.0.0.1:8080/api/approvals/<approval id>
It answers 403 {"error":"not_approver","message":"maya may not decide approval <id>"}. Tom, Alice or Fiona, who cannot see the approval at all,
get 404 not_found. Rejecting ({"approved": false}) is refused the same
way.
Refuse it#
- Choose Sign out in the account menu and pick Ada Park (admin) under Demo people. The sidebar's Inbox shows 1.
- Click Inbox. Under Waiting on you is the refund card, marked "Waiting for you", with "You decide" in its footer. Open Why am I asked? to see the checks, ending with "The policy asks anyone with the admin role."
- Press Reject. Type a reason in Reason (required), such as
Billing is already refunding this by hand, and press Confirm reject. The toast says "Issue a refund or credit: rejected · Maya Patel was told". - Waiting on you is gone. Sign in as maya: her sidebar Inbox shows 1, the Declined update. Open the conversation: the card reads Rejected with "Rejected by Ada Park", the watcher's result reads the same with its Details line Rejected, and the task is Cancelled. Opening the conversation marks the Declined update read, since the conversation says the same. No refund was made.
Approve it#
- As maya, in the same conversation, ask again:
Northwind wants a refund for the double charge. A new card appears, Waiting for Ada Park. - As ada, open Inbox, press Approve $250.00 on the refund card, then Approve $250.00 again in the confirmation. The toast says Approved and Waiting on you is gone. Under Everything, the item now reads Issue a refund or credit: approved with an Approved badge.
- As maya, open the conversation. The card says "Approved by Ada
Park", and below it the watcher's result: "Refunded after an admin
approved it.", amount $250.00, invoice
inv-2026-09-1042, refundre_3Rk0a1Lq, Done. Maya's inbox has a Completed update until she opens the conversation.
Confirm the run resumed#
- On the approved card, press See the run. A Run panel opens beside the conversation. Its Trace lists, in order: Read data (Read Tickets: 1 row), Tool (Billing account Ok), Approval (Asked for approval), Decision (Approval Approved), Tool (Issue a refund or credit Ok), and the model and round steps around them. The ticket and the billing account were read once, before the approval; nothing before the approval ran twice.
Asking for the same refund a third time is refused before anyone is asked. In the run's Trace, a Refused step reads "Refused: policy denied Issue a refund or credit: Invoice inv-2026-09-1042 was already refunded (re_3Rk0a1Lq on ...)" ("already has a refund waiting for approval" while one is pending). With the stub planner the conversation still says "Refunded after an admin approved it." and Done, with no refund id, which is wrong: no refund was made. This is a known bug in the demo's stub planner.
The email approval: one click, and who else may decide#
- Sign in as alice (sales rep). Click Threads, then Sales
Assistant. Ask
Email a follow up to my contacted lead. - The card Send email, Waiting for you, shows the recipient
dana@litware.example, the subject "Following up on our demo" and the full text, with Approve and Reject. It is also in Alice's inbox under Waiting on you. - As ada, open Inbox. Waiting on others 1 is folded; click it. The card reads Waiting for Alice Chen, its footer "Alice Chen decides", and it has no buttons.
- As alice, press Approve. There is no confirmation. The toast
says Approved; the conversation shows "Approved by Alice Chen" and
the result with Sent
msg-...and Done.
Sam, who leads Sales, may also decide Alice's emails: as sam, the card
waits in Inbox under Waiting on you, with Approve and
Reject. Through the API it is the same: ask once more as Alice, then,
with the API token ok demo serve printed for Sam and the new approval's
id:
curl -X POST -H "Authorization: Bearer <sam's token>" \
-H 'content-type: application/json' \
-d '{"approved": false, "note": "Not this week"}' \
http://127.0.0.1:8080/api/approvals/<approval id>
The approval comes back with "state": "rejected" and "decided_by": "sam", and Alice gets "Declined 'Email a follow up to my contacted lead':
Sam Ortiz rejected "Send email": Not this week".
Not possible yet#
- A notification to an agent's manager for an approval addressed to someone else: it waits under Waiting on you, with no inbox item of its own.
- Delegating or reassigning a single approval to another person.
- Changing a decision once made.
- A time limit on approvals asked by OrchKernel's own agents.
For developers#
API#
All under /api, with Authorization: Bearer <token> (see
Tokens).
| Method and path | Body | Notes |
|---|---|---|
GET /inbox |
Your unread items, newest first. ?all=true for every item. Paged. Each item: id (approval:<id>, question:<id>, mention:<id>, task:<id>, note:<id> ...), at, title, kind, read, data, plus the kind's fields (approval, thread and from, task, question and run, proposal). |
|
POST /inbox/:id/read |
Marks one of your items read. {"ok": true} when it was found, {"ok": false} otherwise. |
|
GET /approvals |
Pending approvals: every one for an admin, else those addressed to you or that you may decide (a role you hold, the agent's manager). Paged. | |
GET /approvals/:id |
One approval: requester, acting_for, approver, approver_kind (role, acting_for, owner, actor, manager), action, reason, payload, run, task, thread, state, decided_by, decided_at, note, result (what the approved action returned), trail, matched_rule, approver_rule, policy_hash. 404 if you may not see it. |
|
GET /approvals/:id/explain |
{ asked, now, changed }: why it was asked and what the policy says now. See Policy. |
|
POST /approvals/:id |
{ approved, note?, edited? } |
Decide. Returns the approval. Deciding one already decided returns it unchanged. edited changes the arguments a tool lets an approver edit (a draft reply's text and subject), only for the person the call acts for (403 otherwise, 422 not_editable for any other argument); the whole gate runs again on them. |
GET /questions |
Questions put to you (or escalated to you), newest first. Paged. ?open=true only those still waiting; ?thread=<id> or ?run=<id> the questions of a thread or run you may read. Each is a question (below). |
|
GET /questions/:id |
One question: id, run, task, recipient, allowed (who may answer besides admins), question, options, asked_at, answer ({ text, by, at, for_whom?, auto? } once answered), withdrawn_at, intended (whom it was meant for when it came to you first), due_at, next (who it goes to next, or what then), forwarded, class (the kinds of data its run carried, in words), restored, and for you asker, for (the person the agent works for on it: whom its run acts for, else the task's owner when a person owns it), title (what the agent was asked to do; null unless you may read its thread or run), thread, state (open, answered, withdrawn, or closed when its run ended another way), can_answer, can_see_thread, can_see_run, run_state. Readable by whoever may answer it and whoever may see its run; 404 otherwise. Reading it does not open its thread. |
|
POST /questions/:id/forward |
{ to, note?, confirm? } |
Pass it on. 403 for someone who may not answer it, or when to may not read what its run carries and you are not the person the work is for confirming (confirm: true); 422 for someone not active; 409 answered, withdrawn; 429 after the third pass. Answers the question view. |
POST /questions/:id/answer |
{ answer, detach? } |
Answer this question; the run resumes with the text. Answers like an ask (200 with the outcome, 202 running off the request), with answered, the question as answered. 403 denied for anyone it was not put to (admins excepted); 409 answered, withdrawn or not_waiting; 422 for an empty answer or one over 4,096 bytes. |
POST /runs/:id/answer |
{ answer, detach? } |
Answer whatever question the run waits on now; the run resumes. The person asked may use it without seeing the run. |
Errors from POST /approvals/:id:
| Status and code | When |
|---|---|
403 not_approver |
You may not decide it ("maya may not decide approval ..."). |
403 denied |
The agent or tool is paused ("policy denied approve(...): crm is paused"), the policy now names another approver you do not satisfy, or an outside agent's action that only the person it acts for may approve. |
404 not_found |
You may not see it. |
409 now_denied |
The policy now refuses the action. The approval stays pending. |
Events#
| Event | When |
|---|---|
approval_requested |
An action waits for approval: approval, approver, action. |
run_parked, run_resumed |
The run stopped for the approval or question, and carried on. |
approval_resolved |
Someone decided: approval, by, approved. |
question_asked, question_answered |
A run asked a person, and got the answer. |
question_forwarded |
Someone passed a question on: question, from, to, by. |
question_timed_out |
A question's time passed: then is next, assumed or stopped. |
model_help_requested, model_help_declined, model_clearance_changed |
Ask an admin, Keep as is, and a model's clearance raised (prompted_by: the run that led to it). |
CLI#
The CLI opens the state file directly (on the demo,
--state orchkernel-demo/state.db). ok inbox only reads, so it works while
the server runs; ok approve and ok answer change the state, so stop the
server first: while it runs they are refused and write nothing (see
Where a command works).
ok --state <state.db> --as ada inbox # unread items: * title item-id
ok --state <state.db> --as ada inbox --all # every item
ok --state <state.db> --as ada approve <approval-id>
ok --state <state.db> --as alice approve <approval-id> --reject --note "Not this week"
ok --state <state.db> --as maya answer <run-id> "September"
ok inbox prints item ids such as approval:4474d1d0-...; pass ok approve
only the part after approval:, or it answers "Error: approval
approval:... not found". ok approve prints the decided approval as JSON. A
wrong person gets Error: maya may not decide approval <id> and exit
status 1. Approving from the CLI runs the action from the CLI process, so on
the demo, where the tools are local fakes started by ok demo serve,
approve from the workspace or the API instead and use the CLI to reject.