Repository navigation
feat(core): let a workflow agent pin a directory and outlive the default bounds #8972
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 9 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8f3f173
feat(core): let a workflow agent pin a directory and outlive the defa…
qqqys 189ea1f
Merge branch 'main' into workflow/agent-working-dir
qqqys af057d6
fix(workflows): harden agent worktree pinning
qqqys c46bcdc
Merge branch 'main' into workflow/agent-working-dir
wenshao d6d197e
Merge branch 'main' into workflow/agent-working-dir
qwen-code-dev-bot b78fc69
fix(workflows): anchor worktree-pin containment at the main working tree
qwen-code-dev-bot dc40e92
Merge branch 'workflow/agent-working-dir' of https://github.com/qqqys…
qwen-code-dev-bot b989dc3
fix(workflows): refuse truncated main-tree anchors in worktree pinnin…
qwen-code-dev-bot 8b49682
Merge branch 'main' into workflow/agent-working-dir
qwen-code-dev-bot 1ef8777
fix(workflows): harden worktree pinning per round-3 review (#8972)
qwen-code-dev-bot 6fd1953
fix(workflows): type worktree-pin test stub as nullable per service (…
qwen-code-dev-bot 0c16d2d
Merge remote-tracking branch 'origin/main' into workflow/agent-workin…
qwen-code-dev-bot 29b866c
Merge branch 'main' into workflow/agent-working-dir
qwen-code-dev-bot cdcb10a
fix(workflows): harden stallMs gate and test portability per round-4 …
qwen-code-dev-bot 5158c81
test(webui): deflake same-session refresh transcript assertion (#8972)
qwen-code-dev-bot 1fce8f9
Merge remote-tracking branch 'origin/main' into workflow/agent-workin…
qwen-code-dev-bot f11b7eb
docs: note the workflow workingDir opt is stricter than working_dir (…
qwen-code-dev-bot eaa6d6b
fix(core): sanitize workingDir echo in workflow refusal errors (#8972)
qwen-code-dev-bot 49bfc9f
fix(core): name the subagent turn/time env caps in the workflow tool …
qwen-code-dev-bot 0e365af
fix(core): preserve trailing CR in git worktree path answers (#8972)
qwen-code-dev-bot 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
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 |
|---|---|---|
|
|
@@ -21,9 +21,9 @@ | |
| * key, and so on — so the cache naturally invalidates from the edit point. | ||
| * | ||
| * The `canonicalOpts` projection keeps only the dispatch-affecting opts | ||
| * (`schema`, `model`, `isolation`, `agentType`) with object keys sorted, so | ||
| * cosmetic opt differences (a re-ordered schema, a `label` change) don't | ||
| * bust the cache. | ||
| * (`schema`, `model`, `isolation`, `agentType`, `workingDir`) with object keys | ||
| * sorted, so cosmetic opt differences (a re-ordered schema, a `label` change) | ||
| * don't bust the cache. | ||
| * | ||
| * Determinism requirement: workflow scripts are deterministic (`Date.now` | ||
| * / `Math.random` throw in the sandbox), so the sequence of `agent()` | ||
|
|
@@ -66,14 +66,25 @@ export interface JournalReplay { | |
|
|
||
| /** | ||
| * Project the dispatch-affecting opts into a stable canonical string. Only | ||
| * `schema` / `model` / `isolation` / `agentType` change what the dispatch | ||
| * does; `label` / `phase` / `stallMs` are cosmetic or operational and must | ||
| * NOT bust the cache. Object keys are sorted recursively so a re-serialized | ||
| * schema with reordered keys hashes the same. | ||
| * `schema` / `model` / `isolation` / `agentType` / `workingDir` change what | ||
| * the dispatch does; `label` / `phase` / `stallMs` are cosmetic or | ||
| * operational and must NOT bust the cache. Object keys are sorted recursively | ||
| * so a re-serialized schema with reordered keys hashes the same. | ||
| * | ||
| * `workingDir` is dispatch-affecting for the same reason it exists: the same | ||
| * prompt run against two different worktrees is two different questions. Were | ||
| * it projected away, a resume that changed only the directory would replay | ||
| * the previous tree's answers as if they were this one's. | ||
| */ | ||
| export function canonicalizeAgentOpts(opts: WorkflowAgentOpts): string { | ||
| const projected: Record<string, unknown> = {}; | ||
| for (const k of ['schema', 'model', 'isolation', 'agentType'] as const) { | ||
| for (const k of [ | ||
| 'schema', | ||
| 'model', | ||
| 'isolation', | ||
| 'agentType', | ||
| 'workingDir', | ||
| ] as const) { | ||
|
Comment on lines
+81
to
+87
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已修复:journal fileoverview 已把 workingDir 纳入 dispatch-affecting canonical options。验证证据:Prettier、ESLint、diff check 通过。 |
||
| const v = opts[k]; | ||
| if (v === undefined || typeof v === 'function') continue; | ||
| projected[k] = v; | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declined — no code change this round. Your own deterministic probe records that the behaviour is already gated: adding
'workingDir'to thecanonicalizeAgentOptsprojection is mutation-killed, and a whole-file revert is caught byworkflow-journal.test.ts. Only the prose comment is ungated, and the finding explicitly states no code change is required for this PR. Gating the prose itself would mean a brittle assertion on comment text, so per the repo's simplicity rule we are not growing the diff for it. The residual drift risk (a future change droppingworkingDirfrom the projection leaving this JSDoc stale) is acknowledged and recorded here; the projection assertion inworkflow-journal.test.tsremains the behavioural gate.中文说明
拒绝——本轮不做代码改动。您自己的确定性探针已确认行为本身有测试拦截:把
'workingDir'加入canonicalizeAgentOpts投影会被变异杀死,整文件回退也被workflow-journal.test.ts拦截。只有这段文字注释没有被钉住,且该发现明确写明本 PR 无需改动代码。要钉住文字本身,只能靠对注释文本的脆弱断言,因此按本仓库的简洁性原则不为此扩大 diff。残余的漂移风险(未来改动把workingDir从投影中移除、这段 JSDoc 随之过期而无人提示)在此记录在案;workflow-journal.test.ts中的投影断言仍是行为层面的拦截。