Replace default AI task sub-agent rule with continue-immediately guidance #2940
Service Desk opened 2 days ago

Context

From issue #2939 (oh-my-openagent / custom OpenCode images that rely heavily on sub-agents): the current default AI task automation Rules preamble in DefaultWorkspaceService is:

### Rules
You are talking to an AI user.
If you start any sub-agents, wait for them to complete before finishing.

That only covers “don’t finish while sub-agents are still running.” In practice with heavy sub-agent use, the parent agent can still pause or emit “waiting” messages after sub-agents have already returned, which stalls headless workspace task runs.

Requested change

Replace the sub-agent line above with:

Do not pause or output 'waiting' messages after sub-agents complete. Immediately process their results, write the code changes, and execute the implementation in this session.

Location: server-core/src/main/java/io/onedev/server/workspace/DefaultWorkspaceService.java (task prompt construction for workspace task automation).

Notes

  • Reporter confirmed the old “wait for sub-agents” rule was previously suggested by them; the new wording is what actually works with their oh-my-openagent setup.
  • Related discussion in issue #2939 also covers preferring OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true (env var inherited by sub-agents) in addition to --dangerously-skip-permissions on the main opencode run — consider whether built-in Open Code workspace templates should set the env var as a separate change.
  • Service Desk referenced from other issue 2 days ago
  • Zak Siddiqui commented 2 days ago

    This is dependent on OD-2934

  • Service Desk commented 2 days ago

    Noted @zaakiyissue #2934 is already closed; the agreed follow-up is issue #2935 (Task Automation checkbox / template default for OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS). I've marked this issue as Blocked By #2935.

  • Zak Siddiqui commented 2 days ago

    @servicedesk ensure to retain

    ### Rules
    You are talking to an AI user.
    

    Even though we are blocked, plan the changes here, in anticipation of #2935 being completed.

  • Service Desk commented 2 days ago

    @zaakiy — Confirmed. We'll keep the ### Rules header and You are talking to an AI user. line.

    Planned change (once issue #2935 unblocks)

    File: server-core/src/main/java/io/onedev/server/workspace/DefaultWorkspaceService.java (task prompt construction, ~lines 1156–1157)

    Current preamble:

    ### Rules
    You are talking to an AI user.
    If you start any sub-agents, wait for them to complete before finishing.
    

    Planned preamble:

    ### Rules
    You are talking to an AI user.
    Do not pause or output 'waiting' messages after sub-agents complete. Immediately process their results, write the code changes, and execute the implementation in this session.
    

    Scope

    • This issue: only the preamble string replacement above.
    • OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS / Task Automation checkbox remains in issue #2935.

    Does this planned wording look good to you?

  • Zak Siddiqui commented 2 days ago

    new text

    Do not pause or output 'waiting' messages after sub-agents complete. Immediately process their results, write any required code changes, and execute the implementation in this session.
    
  • Service Desk commented 2 days ago

    @zaakiy — Noted. Updated plan with your wording:

    ### Rules
    You are talking to an AI user.
    Do not pause or output 'waiting' messages after sub-agents complete. Immediately process their results, write any required code changes, and execute the implementation in this session.
    

    We'll implement this string replacement in DefaultWorkspaceService once issue #2935 unblocks.

  • Robin Shen changed fields 14 hours ago
    Name Previous Value Current Value
    Assignee
    robin
    wh
  • Work Horse commented 14 hours ago

    Implemented the agreed Rules preamble change in DefaultWorkspaceService, keeping the ### Rules header and You are talking to an AI user. line, and replacing the sub-agent wait rule with continue-immediately guidance.

    See pull request #103

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