Repository navigation
fix(harness): command arms send the task instruction as written, no dokimi wrapper #401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5914267
fix(harness): command arms send the task instruction as written, no d…
napetrov 87de7da
test: move the raw-prompt check to its own file (file-length ratchet)
napetrov c4e06c9
Merge branch 'main' of https://github.com/intel/dokimi into feat/cmd-…
napetrov dba386c
Scope the raw-prompt changelog entry to command arms
antonwolfy cdcb9c8
Test all three prompt placeholders on a multi-line instruction
antonwolfy 81aea98
Merge branch 'main' of https://github.com/intel/dokimi into feat/cmd-…
napetrov bdf2df3
Address review: changelog wording, already fixed in dba386c
napetrov 06b3156
Address review: prompt placeholder test, already fixed in cdcb9c8
napetrov f36cef8
Address review: nits of the LGTM review, already fixed in dba386c and…
napetrov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
dokimi/changelog.d/20261104_120000_napetrov_raw-task-prompt.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <!-- | ||
| Copyright (C) 2026 Intel Corporation | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
|
|
||
| ### Changed | ||
|
|
||
| - **Command arms (`command:` and `--command-template`) send the task instruction as written** — the `Solve this coding task. Work only inside the task environment…` and `# Task: <name>` lines that dokimi put around `{prompt}` are gone, as a user's agent never sees them. `{prompt}` and `{prompt_quoted}` now expand to the bare `instruction.md`, and `{prompt_escaped}` to the same text with `{` and `}` doubled. Command-arm runs measured before this change are not comparable in their prompt text. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Copyright (C) 2026 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """A command arm's prompt is the task instruction as written, with no dokimi wrapper.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from dokimi.harnesses.command import CommandHarness | ||
| from dokimi.harnesses.tasks import TaskSpec | ||
|
|
||
|
|
||
| def test_command_prompt_is_the_raw_instruction(tmp_path): | ||
| task = TaskSpec(name="toy", path=tmp_path / "toy", instruction="Fix the off-by-one in sum().") | ||
| harness = CommandHarness("fake", "echo {prompt_quoted}") | ||
| argv = harness.build_command(task, model=None, output_dir=tmp_path / "out") | ||
| assert argv == ["echo", "Fix the off-by-one in sum()."] | ||
|
|
||
|
|
||
| def test_every_prompt_placeholder_keeps_a_multiline_instruction_as_written(tmp_path): | ||
| instruction = "Fix {x}.\nSecond line.\n" | ||
| task = TaskSpec(name="toy", path=tmp_path / "toy", instruction=instruction) | ||
|
|
||
| def argv(template): | ||
| harness = CommandHarness("fake", template) | ||
| return harness.build_command(task, model=None, output_dir=tmp_path / "out") | ||
|
|
||
| assert argv("echo '{prompt}'") == ["echo", instruction] | ||
| assert argv("echo {prompt_quoted}") == ["echo", instruction] | ||
| assert argv("echo '{prompt_escaped}'") == ["echo", "Fix {{x}}.\nSecond line.\n"] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.