False "Failed to do the job" when AI agent output contains the literal run-prompt marker: markers should be per-run nonces, not constant strings
#3308
-
Checking the output directly from terminal provides the most simple and consistent implementation across various workspace provisioning implementations. In practice, an agent is not likely to output
__ONEDEV_RUN_PROMPT_SUCCESS__if not doing it intentionally. . Please share a case without deliberately outputing the full marker (SUCCESS or FAILURE alone will not match the full marker).
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Affected Versions |
17.2.4
|
| Labels |
No labels
|
Issue Votes (0)
Summary
In Task Automation for AI users,
DefaultWorkspaceService.openPromptShelldecides whether a workspace task succeeded or failed by searching for two constant strings - the constantsRUN_PROMPT_SUCCESS_MARKERandRUN_PROMPT_FAILURE_MARKER, with literal values__ONEDEV_RUN_PROMPT_+SUCCESS__and__ONEDEV_RUN_PROMPT_+FAILURE__- in a rolling 1024-character buffer of the workspace terminal output. The markers are shared constants: the same strings for every workspace, every spec and every run.If the agent's own output printed to that terminal happens to contain the literal marker text - for example, an agent reading an issue body that contains it as a test-fixture string - OneDev posts a failure ("Failed to do the job, please open workspace #N for details") while the agent is still working. The symmetrical case is worse: a literal SUCCESS marker printed by the agent causes the workspace to be silently deleted as a success (when "Delete Workspace If Succeeded" is enabled).
PosixShell.printMarkerdeliberately splits the marker into twoprintfarguments, so echoing the generated task script does not trigger a match - but the agent's own output is not protected, and detection never consults the exit code: any matching text from any source in the stream decides the outcome.Real-world impact (measured)
On our OneDev 17.2.4 instance (an AI-assisted development pipeline, three AI users, ~234 workspaces in one week):
Minimal repro
Expected behavior
The marker OneDev watches for should be unique per run, not a constant string shared across all workspaces. Alternatives, in decreasing preference:
Our current workaround is a stream filter on the agent's stdout that breaks up marker-like lines before they reach the panel; it is fragile, spec-local, and cannot protect the SUCCESS case in third-party setups.
Environment
maincommit52616e9(2026-12-05, includes release 17.2.8).Happy to provide full timelines and the repro script.