Build the worktree-isolation notice for a fork child. Mirrors ``buildWorktreeNotice()`` from ``forkSubagent.ts:205-210``. The notice tells the child to translate inherited paths to the worktree root, re-read potentially stale files, and that its changes stay isolated.
(parent_cwd: str, worktree_cwd: str)
| 254 | |
| 255 | |
| 256 | def build_worktree_notice(parent_cwd: str, worktree_cwd: str) -> str: |
| 257 | """Build the worktree-isolation notice for a fork child. |
| 258 | |
| 259 | Mirrors ``buildWorktreeNotice()`` from ``forkSubagent.ts:205-210``. The |
| 260 | notice tells the child to translate inherited paths to the worktree |
| 261 | root, re-read potentially stale files, and that its changes stay |
| 262 | isolated. |
| 263 | """ |
| 264 | return ( |
| 265 | f"You've inherited the conversation context above from a parent agent " |
| 266 | f"working in {parent_cwd}. You are operating in an isolated git worktree at " |
| 267 | f"{worktree_cwd} — same repository, same relative file structure, separate " |
| 268 | f"working copy. Paths in the inherited context refer to the parent's working " |
| 269 | f"directory; translate them to your worktree root. Re-read files before editing " |
| 270 | f"if the parent may have modified them since they appear in the context. Your " |
| 271 | f"changes stay in this worktree and will not affect the parent's files." |
| 272 | ) |
| 273 | |
| 274 | |
| 275 | def _get_attr(obj: Any, name: str, default: Any) -> Any: |
no outgoing calls