test(plugin): preserve working-directory integration after rebase
This commit is contained in:
1 parent
ee0ead1a61
commit
562f63eccd
4 files changed
+28
-10
No files matched your search
@@ -173,8 +173,8 @@ describe.skipIf(!existsSync(join(root, 'apps/cli/lib/bin.js')))('Official option
|
||||
it('keeps the default host and minimal tool catalogs while every optional bundle is off', async () => {
|
||||
const minimal = await agent('minimal')
|
||||
const standard = await agent()
|
||||
expect(names()).toEqual([])
|
||||
expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash'])
|
||||
expect(names()).toEqual(['working_directory'])
|
||||
expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash', 'working_directory'])
|
||||
for (const name of ['str_replace_editor', 'session_search', 'terminal_open', 'ralph']) expect(names(standard.agent)).not.toContain(name)
|
||||
expect((await ctx.skills.list({ cwd: workspace, scope: standard.agent })).some(skill => skill.name === 'dsh-badge')).toBe(false)
|
||||
})
|
||||
@@ -216,7 +216,7 @@ describe.skipIf(!existsSync(join(root, 'apps/cli/lib/bin.js')))('Official option
|
||||
expect(assembly.tools.map(tool => tool.name)).toEqual(['run_code'])
|
||||
expect(assembly.sections.find(section => section.name === 'tools:sdk')?.text).toContain('str_replace_editor')
|
||||
expect(names(native.agent)).toContain('str_replace_editor')
|
||||
expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash'])
|
||||
expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash', 'working_directory'])
|
||||
await turn(coded.agent, 'Create the file with the editor through run_code.', [
|
||||
toolCallResponse('ptc-editor', 'run_code', {
|
||||
code: `console.log(await tools.str_replace_editor(${JSON.stringify({ command: 'create', path: target, file_text: 'PTC_EDITOR_OK' })}));`,
|
||||
@@ -272,7 +272,7 @@ describe.skipIf(!existsSync(join(root, 'apps/cli/lib/bin.js')))('Official option
|
||||
expect(toolResult(owner.agent, 'badge-on')).toContain('dsh-badge.png')
|
||||
const minimal = await agent('minimal')
|
||||
expect((await ctx.skills.list({ cwd: workspace, scope: minimal.agent })).map(skill => skill.name)).toContain('dsh-badge')
|
||||
expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash'])
|
||||
expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash', 'working_directory'])
|
||||
await select(bundles.badge, false)
|
||||
expect((await load('badge-after')).isError).toBe(true)
|
||||
})
|
||||
@@ -378,8 +378,8 @@ describe.skipIf(!existsSync(join(root, 'apps/cli/lib/bin.js')))('Official option
|
||||
expect(await readFile(target, 'utf8')).toBe('COMBINED_BUNDLES_OK')
|
||||
expect(toolResult(coded, 'combined-program')).toContain('dsh-badge')
|
||||
const minimal = await agent('minimal')
|
||||
expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash'])
|
||||
expect(names()).toEqual([])
|
||||
expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash', 'working_directory'])
|
||||
expect(names()).toEqual(['working_directory'])
|
||||
for (const name of [...Object.values(bundles)].reverse()) await select(name, false)
|
||||
expect(names((await agent()).agent)).not.toContain('str_replace_editor')
|
||||
})
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{"type":"step/start","data":{"turn":1,"step":1}}
|
||||
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"Use the optional string editor from the generated tools SDK in one run_code program to create edited.txt in the working directory containing exactly PTC_EDITOR_OK followed by a newline. Print the editor result, then reply DONE."}],"source":{"kind":"user","rpcId":"{{rpc:1}}","clientTimeZone":"{{clientTimeZone}}"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"Current runtime context. This snapshot supersedes earlier runtime-context snapshots.\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval policy: ask. Operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval policy: ask. Operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"Current runtime context. This snapshot supersedes earlier runtime-context snapshots.\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval policy: ask. Operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval policy: ask. Operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"Time sampled while preparing turn 1, step 1: {{timeContextTimestamp}}\nBrowser time zone for this request: {{clientTimeZone}}. Interpret otherwise-unqualified dates and times in this zone.\nElapsed since the preceding model-visible message: {{elapsed}}"}],"source":{"kind":"time-context","form":"snapshot","sections":[{"name":"time-context","text":"Time sampled while preparing turn 1, step 1: {{timeContextTimestamp}}\nBrowser time zone for this request: {{clientTimeZone}}. Interpret otherwise-unqualified dates and times in this zone.\nElapsed since the preceding model-visible message: {{elapsed}}"}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
|
||||
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}
|
||||
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":128000}}
|
||||
|
||||
@@ -302,6 +302,8 @@ interface ToolArgsMap {
|
||||
} & Record<string, JsonValue>;
|
||||
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. It runs in the background by default and returns a subagent id you can continue with `send_message`; you are notified when the run settles. */
|
||||
subagent: {
|
||||
/** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
|
||||
cwd?: string;
|
||||
/** A short (3-5 word) description of the delegated task, for display. */
|
||||
description: string;
|
||||
/** The complete, self-contained task for the subagent. It does not share this conversation's context, so include everything it needs. */
|
||||
@@ -311,6 +313,8 @@ interface ToolArgsMap {
|
||||
} & Record<string, JsonValue>;
|
||||
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. It runs in the background by default and returns a subagent id you can continue with `send_message`; you are notified when the run settles. */
|
||||
subagent_fork: {
|
||||
/** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
|
||||
cwd?: string;
|
||||
/** A short (3-5 word) description of the delegated task, for display. */
|
||||
description: string;
|
||||
/** The task for the subagent. It already sees this conversation's completed turns, so build on them freely and state only what is new. */
|
||||
@@ -353,6 +357,11 @@ interface ToolArgsMap {
|
||||
/** 1–4 search queries; their results are merged. */
|
||||
queries: string[];
|
||||
} & Record<string, JsonValue>;
|
||||
/** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
|
||||
working_directory: {
|
||||
/** Existing directory to enter. Omit to read the current directory. */
|
||||
cd?: string;
|
||||
} & Record<string, JsonValue>;
|
||||
/** Create or fully replace a UTF-8 text file. */
|
||||
write: {
|
||||
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
|
||||
@@ -377,13 +386,16 @@ interface ToolOutputMap {
|
||||
bash: {
|
||||
kind: "background";
|
||||
jobId: string;
|
||||
cwd: string;
|
||||
} | {
|
||||
kind: "promoted";
|
||||
cwd: string;
|
||||
jobId: string;
|
||||
timeoutMs: number;
|
||||
output: string;
|
||||
} | {
|
||||
kind: "foreground";
|
||||
cwd: string;
|
||||
exitCode: number | null;
|
||||
signal: string | null;
|
||||
timedOut: boolean;
|
||||
@@ -425,6 +437,7 @@ interface ToolOutputMap {
|
||||
activation: "armed" | "disarmed";
|
||||
};
|
||||
edit: {
|
||||
/** Canonical absolute path in the filesystem execution world. */
|
||||
path: string;
|
||||
before: string;
|
||||
after: string;
|
||||
@@ -518,6 +531,7 @@ interface ToolOutputMap {
|
||||
}[];
|
||||
};
|
||||
read: {
|
||||
/** Canonical absolute path in the filesystem execution world. */
|
||||
path: string;
|
||||
offset: number;
|
||||
lines: {
|
||||
@@ -527,6 +541,7 @@ interface ToolOutputMap {
|
||||
totalLines: number;
|
||||
};
|
||||
read_image: {
|
||||
/** Canonical absolute path in the filesystem execution world. */
|
||||
path: string;
|
||||
image: {
|
||||
attachmentId: string;
|
||||
@@ -926,7 +941,12 @@ interface ToolOutputMap {
|
||||
}[];
|
||||
truncated: boolean;
|
||||
};
|
||||
working_directory: {
|
||||
/** Current absolute working directory. */
|
||||
cwd: string;
|
||||
};
|
||||
write: {
|
||||
/** Canonical absolute path in the filesystem execution world. */
|
||||
path: string;
|
||||
operation: "create" | "update";
|
||||
before: string | null;
|
||||
@@ -951,5 +971,3 @@ Prefer showing the primary results within your final response alongside a brief
|
||||
The DeepSeek Harness implementation checkout is at {{sourceRoot}}. The checkout location and current working directory are separate values and may differ; never infer the working directory from this path. Use pwd to determine the current working directory. Use this checkout only to inspect or extend DSH itself.
|
||||
|
||||
You are interacting with the user through the DeepSeek Harness Web GUI at {{webUrl}}. When the user refers to "this page", "this GUI", or "this app" without naming another target, they mean this GUI. The browser provides no implicit DOM, route, or screenshot context. The client-plugin HMR receiver is active, but client-plugin changes reload without a refresh only while `pnpm run dev:web` is also running from this same checkout to rebuild their bundles; verify that watcher before promising automatic updates. Every other change — the apps/web shell and plain packages — requires rebuilding the affected Web artifacts and verifying this existing URL after a page refresh. Starting another server does not update this GUI. The apps/web Vite entry builds the shell but is not a standalone application because only dsh web injects window.__DSH_BOOT__. Do not start a replacement server unless the user asks; if one is needed, use a managed background job and verify its exact URL.
|
||||
|
||||
Your working directory is {{cwd}}.
|
||||
@@ -2,7 +2,7 @@
|
||||
"initial": [
|
||||
{
|
||||
"name": "run_code",
|
||||
"description": "Execute a TypeScript program against the available tools. Takes two required arguments: `description`, a short summary of what the program does, and `code`, the BODY of an async function (erasable syntax only; top-level `await` and `return` work). Call tools as `await tools.name(args)` per the declarations in the system prompt. Only what you print or return is program output — curate it. Image-bearing subtool results are attached after the run. Each call runs in a fresh Node process. Node APIs are available through await import(...). Relative paths use the supplied working directory; process.env starts empty. Direct filesystem access follows this execution's sandbox policy. The working directory is the Session's current directory. A sandbox escalation approves this complete program for one execution only. Nested tools retain their own policies and approvals. Request wider access only after evidence of a denial. Earlier effects may already have completed: inspect them before explicitly retrying. Programs are never replayed automatically.",
|
||||
"description": "Execute a TypeScript program against the available tools. Takes two required arguments: `description`, a short summary of what the program does, and `code`, the BODY of an async function (erasable syntax only; top-level `await` and `return` work). Call tools as `await tools.name(args)` per the declarations in the system prompt. Only what you print or return is program output — curate it. Image-bearing subtool results are attached after the run. Each call runs in a fresh Node process. Node APIs are available through await import(...). Relative paths use the supplied working directory; process.env starts empty. Direct filesystem access follows this execution's sandbox policy. Each program starts in the Session's current directory. Running programs keep their initial directory. A sandbox escalation approves this complete program for one execution only. Nested tools retain their own policies and approvals. Request wider access only after evidence of a denial. Earlier effects may already have completed: inspect them before explicitly retrying. Programs are never replayed automatically.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in new issue
Block a user