Step by step guide to set up AI service desk #2885
Robin Shen opened 23 hours ago
No description
  • Service Desk commented 23 hours ago

    Here is a step-by-step guide to set up an AI service desk: an AI user that is auto-assigned to Questions (and optionally other tickets), answers from docs/code without changing code, and escalates when needed.

    Official docs this builds on:


    1. Create the AI user

    1. Go to Administration → Users → Add User.
    2. Set Type to AI.
    3. Pick the chat/model settings for interactive use.
    4. Configure Entitlement so only trusted users/projects can invoke this AI user (start narrow; widen later).
    5. Set a system prompt that defines the service-desk behavior. Example:
    When you are assigned with an issue of type "Question", try to answer the question without creating branch or change code. If user is fine with the answer, close the issue; otherwise, escalate to @<human-owner>. Project "onedev/docs" may also be useful when answer questions.
    

    Replace @<human-owner> with the login of the person who should take over when the AI cannot answer confidently.


    2. Grant project permissions (service-desk style)

    For a Q&A service desk that should not push code:

    1. Prefer a role with Create Workspaces and code Read only (for example the built-in Workspace Creator role), or a custom role with Create Workspaces enabled.
    2. Authorize that role for the AI user on the projects it should support (project Settings → Authorization, or via a group).

    Docs note: if the AI user is only expected to answer questions (service desk style), Create Workspace alone is enough. Grant Code Writer only if you also want it to implement issues / open PRs.


    3. Configure a workspace spec with task automation

    AI users work on assigned issues via workspaces.

    1. In a suitable project (often a root/parent project so children inherit), open Settings → Workspace Specs.
    2. Create a spec from a template (for example Codex in Container or OpenCode in Container).
    3. Enable Task automation, and set Applicable AI User for Task Automation to your AI service-desk user (or leave it matching so this user can use the spec).
    4. OneDev uses the first applicable spec it finds when the AI user creates a workspace.

    4. Bootstrap workspace credentials (run as the AI user)

    1. Run as the AI user (impersonate).
    2. Open the project code page and create a workspace from the spec above.
    3. Complete agent sign-in / model setup inside the workspace (device code, API keys, trust directory, etc., depending on the agent).
    4. Delete the workspace when done. OneDev persists configured user data for that AI user; later automated workspaces reuse it.
    5. To reconfigure later, clear that AI user's workspace data and repeat.

    5. Auto-assign Questions (and similar tickets) to the AI user

    Create a Groovy script under Administration → Groovy Scripts, for example:

    import io.onedev.server.util.EditContext
    
    def type = EditContext.get().getInputValue("Type")
    def priority = EditContext.get().getInputValue("Priority")
    
    if (type == "Question" || type == "Bug" || priority == "Minor")
    	return "servicedesk"
    else
    	return "robin"
    

    Adjust login names and conditions to match your triage rules.

    Then wire it as the default assignee:

    1. Go to Administration → Issue Setting → Custom Fields (or project field overrides).
    2. Edit the Assignee field.
    3. Set Default Value to Evaluate script to get default value.
    4. Select the script by name.

    After this, new issues matching the script are assigned to the AI user automatically. See Default Assignee and Scripting.


    6. (Optional) Combine with email Customer Service Desk

    If external users should open tickets by email:

    1. Configure Mail Service with Check incoming email, and enable subaddressing for the system address. Test send/receive.
    2. Enable global Service Desk settings and add issue creation settings (sender/project rules, default fields such as Type/Priority/Assignee).
    3. Optionally set a per-project service desk name/email.

    Email-created issues then follow the same assignee defaults / creation-field settings, so they can land on the AI user as well. See Customer Service Desk.


    7. Day-to-day operation

    1. A user opens a Question (or your script selects the AI user for other types).
    2. The AI user is assigned → it creates a workspace from the automated spec, investigates (code + onedev/docs as needed), and posts an answer as an issue comment.
    3. For Questions, it should not create a branch or change code.
    4. If the answer is accepted, close the issue; if not, escalate by mentioning the human owner from the system prompt.

    You can also @mention the AI user in a comment to ask a follow-up without reassigning. See Give AI User Instructions.


    Checklist

    StepWhat to verify
    AI userType=AI, system prompt set, entitlements correct
    PermissionsCreate Workspaces on target projects; no Write code unless you want code changes
    Workspace specTask automation enabled; applicable to this AI user
    User dataAgent authenticated after a one-time "run as" workspace
    Assignee defaultGroovy script returns the AI login for Question (etc.)
    Optional emailMail check + service desk creation settings

    If this guide is enough, we can close the issue; otherwise say what is still unclear.

  • Zak Siddiqui commented 23 hours ago

    if we later switch to an enterprise license, do all of the AI users that we create also need to be licensed?

  • Service Desk commented 23 hours ago

    @zaakiy No — AI users do not need separate enterprise licenses, and they do not count toward enterprise user-month billing.

    Enterprise Edition is priced per ordinary (human) user ($6/user/month). User-month calculation only counts non-disabled ordinary accounts. Accounts of type AI and Service are excluded, just like disabled users.

    Creating AI users also does not require Enterprise: AI users are available in Community Edition. Moving to Enterprise unlocks EE features (for example HA/clustering and remote/Kubernetes workspace provisioners); it does not mean each AI user must be licensed.

    See Pricing. On Administration → Subscription Management, you will also see that disabled users (and non-ordinary accounts such as service/AI) are excluded from user-month calculation.

    If that answers your question (and the earlier setup guide is enough), we can close this issue; otherwise say what is still unclear.

  • Zak Siddiqui commented 23 hours ago

    @servicedesk just a correction, it's actually not mentioned on the subscription page.

    It's also not mentioned on the pricing page: https://onedev.io/pricing

    image.png

  • Service Desk commented 23 hours ago

    @zaakiy Thanks for the correction — you're right.

    Neither Pricing nor Administration → Subscription Management currently states that AI users are excluded from Enterprise user-month billing:

    • Pricing only notes that disabled users are excluded from license calculation.
    • On an active subscription, Subscription Management says disabled users and service accounts are excluded — it still does not mention AI users. With an expired trial (as in your screenshot), that note is not shown at all.

    So my earlier reply overstated what those pages document. The product question — whether AI accounts count toward the $6/user/month when you move to Enterprise — needs an authoritative answer.

    @robin Can you confirm whether AI users are excluded from user-month calculation (like service accounts), and whether pricing / Subscription Management should be updated to say so explicitly?

  • Robin Shen commented 23 hours ago

    Yes, AI/service users are excluded from license calcuation. @wh please open an issue on website project and this project and work on it.

  • Service Desk commented 23 hours ago

    @zaakiy Confirmed: AI and service users are excluded from license/user-month calculation.

    When you move to Enterprise, AI users do not need separate licenses and do not count toward the $6/user/month total.

    Updating Pricing and Subscription Management to document this explicitly is being handled separately.

  • Service Desk changed state to 'Closed' 23 hours ago
    Previous Value Current Value
    Open
    Closed
  • Work Horse commented 23 hours ago

    @zaakiy Confirmed by @robin: AI and service users are excluded from Enterprise license / user-month calculation. They do not need separate licenses and do not count toward the $6/user/month.

    I opened the follow-ups Robin asked for:

    • OD-2886 — update Subscription Management copy in this project
    • onedev/website#2 — update the pricing page footnote

    I could not complete those code changes from this account: no write/pull access to onedev/website, and the Subscription Management string lives in server-ee (not pullable here). Notes are on those issues.

    If the AI service desk setup guide earlier and this licensing answer cover your question, we can close this issue; otherwise say what is still unclear.

1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (5)
Reference
OD-2885
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover