Remove the model-facing working_directory tool and the cwd parameter of the
subagent tools, so only Host operations move a Session's directory. Every
change the service records carries `workspace: true`, and the workspace root
is the directory of the last marked change, or the original project. The
anchor field, the anchor list, relocate, inherit, and anchorsOf are gone;
get, ensure, set, and rootOf remain.
A change without the marker, recorded while the model could move the
directory, moves only the current directory, so stored Sessions keep the
root they had.
- worktree: create enters the checkout through set; exit returns the Session
to the source checkout of the recorded worktree that contains its directory,
and exit_worktree exposes it to the model.
- subagent: a child starts in the parent's workspace root or a Host-chosen
directory through set.
- SDK: the working-directory methods return { cwd } again and
getWorkspaceRoot / get_workspace_root are removed.
- Recorded sessions: the worktree scenario leaves through exit_worktree and
covers recovery from a removed worktree; the two scenarios that only drove
the removed tool are deleted; three compaction scenarios lower their tuned
context window by the removed tool-schema tokens.
91 lines
2.8 KiB
TypeScript
91 lines
2.8 KiB
TypeScript
import { join } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { runLoaderSmoke } from '@deepseek-ai/dsh-loader-smoke'
|
|
|
|
const PRODUCTION_PROFILE_PROCESS_TIMEOUT_MS = 60_000
|
|
const PRODUCTION_PROFILE_TEST_TIMEOUT_MS = PRODUCTION_PROFILE_PROCESS_TIMEOUT_MS + 15_000
|
|
|
|
const fixtureDir = fileURLToPath(new URL(
|
|
'./fixtures/loader/',
|
|
import.meta.url,
|
|
))
|
|
const driver = join(fixtureDir, 'driver.ts')
|
|
const configPath = join(fixtureDir, 'codex.patch.yml')
|
|
const repoTsconfig = fileURLToPath(new URL('../../../../tsconfig.json', import.meta.url))
|
|
|
|
describe('Codex provider public Loader composition', () => {
|
|
it('loads the configured default, two named instances, their tools, and job controls without starting Codex', async () => {
|
|
const { stdout, stderr } = await runLoaderSmoke({
|
|
label: 'subagent-codex Loader composition',
|
|
tempDirPrefix: 'dsh-subagent-codex-loader-',
|
|
binScript: driver,
|
|
libBinScript: driver,
|
|
configPath,
|
|
binArgs: [configPath],
|
|
tsconfigPath: repoTsconfig,
|
|
processTimeoutMs: PRODUCTION_PROFILE_PROCESS_TIMEOUT_MS,
|
|
env: {
|
|
// Loading the optional package must not probe or start a Codex binary.
|
|
PATH: '',
|
|
},
|
|
})
|
|
|
|
expect(stderr).toBe('')
|
|
expect(JSON.parse(stdout)).toEqual({
|
|
providers: ['codex', 'codex-primary', 'codex-secondary'],
|
|
providerDetails: [
|
|
{
|
|
name: 'codex',
|
|
capabilities: {
|
|
agentOptions: false,
|
|
agentPreset: false,
|
|
outputSchema: false,
|
|
depthLimit: false,
|
|
},
|
|
inheritsParentContext: false,
|
|
},
|
|
{
|
|
name: 'codex-primary',
|
|
capabilities: {
|
|
agentOptions: false,
|
|
agentPreset: false,
|
|
outputSchema: false,
|
|
depthLimit: false,
|
|
},
|
|
inheritsParentContext: false,
|
|
},
|
|
{
|
|
name: 'codex-secondary',
|
|
capabilities: {
|
|
agentOptions: false,
|
|
agentPreset: false,
|
|
outputSchema: false,
|
|
depthLimit: false,
|
|
},
|
|
inheritsParentContext: false,
|
|
},
|
|
],
|
|
tools: [
|
|
{
|
|
name: 'subagent_codex',
|
|
parameterNames: ['description', 'name', 'prompt'],
|
|
required: ['description', 'prompt'],
|
|
},
|
|
{
|
|
name: 'subagent_codex_primary',
|
|
parameterNames: ['description', 'name', 'prompt'],
|
|
required: ['description', 'prompt'],
|
|
},
|
|
{
|
|
name: 'subagent_codex_secondary',
|
|
parameterNames: ['description', 'name', 'prompt'],
|
|
required: ['description', 'prompt'],
|
|
},
|
|
],
|
|
jobTools: ['job_kill', 'job_list', 'job_output'],
|
|
starts: 0,
|
|
})
|
|
}, PRODUCTION_PROFILE_TEST_TIMEOUT_MS)
|
|
})
|