#Session label?

10 messages · Page 1 of 1 (latest)

stuck badger
#

How can I change the session label programmatically with the WS API? And how do I read it back?

acoustic wolfBOT
solar ibexBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

acoustic wolfBOT
tardy kestrelBOT
#

Use sessions.patch.

Set/change the label

{
  "type": "req",
  "id": "1",
  "method": "sessions.patch",
  "params": {
    "key": "agent:main:subagent:one",
    "label": "Briefing"
  }
}

Response includes the updated entry:

#
{
  "type": "res",
  "id": "1",
  "ok": true,
  "payload": {
    "ok": true,
    "key": "agent:main:subagent:one",
    "entry": {
      "label": "Briefing"
    }
  }
}

Clear the label

#
{
  "type": "req",
  "id": "2",
  "method": "sessions.patch",
  "params": {
    "key": "agent:main:subagent:one",
    "label": null
  }
}

Read it back

Best option right now is sessions.list, then inspect the row for that key:

#
{
  "type": "req",
  "id": "3",
  "method": "sessions.list",
  "params": {}
}

You’ll get rows like:

{
  "sessions": [
    {
      "key": "agent:main:subagent:one",
      "label": "Briefing",
#
      "displayName": "Briefing"
    }
  ]
}

You can also filter by exact label:

{
  "type": "req",
  "id": "4",
  "method": "sessions.list",
  "params": {
    "label": "Briefing"
  }
#
}

And resolve label → key with:

{
  "type": "req",
  "id": "5",
  "method": "sessions.resolve",
  "params": {
    "label": "Briefing",
    "agentId": "main"
  }
}