@@ -171,11 +171,11 @@ if [[ -n "\${FAKE_PLAN_TO_GIT_LOG_PATH:-}" ]]; then
171171 printf '%s\\t%s\\n' "$PWD" "$*" >> "$FAKE_PLAN_TO_GIT_LOG_PATH"
172172fi
173173
174- if [[ "\${1:-}" != "sync" ]]; then
174+ if [[ "\${1:-}" != "import-codex" && "\${1:-}" != " sync" ]]; then
175175 if [[ -n "\${FAKE_PLAN_TO_GIT_LOG_PATH:-}" ]]; then
176176 printf '%s\\tunexpected-command:%s\\n' "$PWD" "\${1:-<empty>}" >> "$FAKE_PLAN_TO_GIT_LOG_PATH"
177177 fi
178- echo "fakePlanToGit: expected sync command, got: \${1:-<empty>}" >&2
178+ echo "fakePlanToGit: expected import-codex or sync command, got: \${1:-<empty>}" >&2
179179 exit 127
180180fi
181181
@@ -383,7 +383,10 @@ describe("git post-push wrapper", () => {
383383 expect ( nodeCwd ) . toEqual ( [ harness . repoDir ] )
384384 expect ( nodeRepoRoot ) . toEqual ( [ harness . repoDir ] )
385385 expect ( nodeScript ) . toEqual ( [ "backup --verbose --background --require-comment" ] )
386- expect ( planToGit ) . toEqual ( [ `${ harness . repoDir } \tsync` ] )
386+ expect ( planToGit ) . toEqual ( [
387+ `${ harness . repoDir } \timport-codex --no-sync` ,
388+ `${ harness . repoDir } \tsync`
389+ ] )
387390 expect ( gh ) . toContain ( `${ harness . repoDir } \tpr create --repo org/repo --base main --head issue-375 --fill` )
388391 } )
389392 ) . pipe ( Effect . provide ( NodeContext . layer ) ) )
@@ -403,7 +406,10 @@ describe("git post-push wrapper", () => {
403406 expect ( nodeCwd ) . toEqual ( [ harness . repoDir ] )
404407 expect ( nodeRepoRoot ) . toEqual ( [ harness . repoDir ] )
405408 expect ( nodeScript ) . toEqual ( [ "backup --verbose --background --require-comment" ] )
406- expect ( planToGit ) . toEqual ( [ `${ harness . repoDir } \tsync` ] )
409+ expect ( planToGit ) . toEqual ( [
410+ `${ harness . repoDir } \timport-codex --no-sync` ,
411+ `${ harness . repoDir } \tsync`
412+ ] )
407413 expect ( gh ) . toContain ( `${ harness . repoDir } \tpr create --repo org/repo --base main --head issue-375 --fill` )
408414 expect ( gitLog . some ( ( line ) => line . startsWith ( `${ harness . externalDir } \t-C ${ harness . repoDir } push` ) ) ) . toBe ( true )
409415 } )
@@ -477,7 +483,7 @@ describe("git post-push wrapper", () => {
477483 } )
478484 ) . pipe ( Effect . provide ( NodeContext . layer ) ) )
479485
480- it . effect ( "propagates plan sync failures after ensuring a PR and before session backup" , ( ) =>
486+ it . effect ( "propagates plan import failures after ensuring a PR and before session backup" , ( ) =>
481487 withHarness ( ( harness ) =>
482488 Effect . gen ( function * ( _ ) {
483489 yield * _ (
@@ -492,7 +498,7 @@ describe("git post-push wrapper", () => {
492498 const gh = yield * _ ( readLogLines ( harness . ghLogPath ) )
493499
494500 expect ( nodeScript ) . toEqual ( [ ] )
495- expect ( planToGit ) . toEqual ( [ `${ harness . repoDir } \tsync ` ] )
501+ expect ( planToGit ) . toEqual ( [ `${ harness . repoDir } \timport-codex --no-sync ` ] )
496502 expect ( gh ) . toContain ( `${ harness . repoDir } \tpr create --repo org/repo --base main --head issue-375 --fill` )
497503 } )
498504 ) . pipe ( Effect . provide ( NodeContext . layer ) ) )
@@ -511,7 +517,10 @@ describe("git post-push wrapper", () => {
511517 const planToGit = yield * _ ( readLogLines ( harness . planToGitLogPath ) )
512518
513519 expect ( nodeScript ) . toEqual ( [ "backup --verbose --background --require-comment" ] )
514- expect ( planToGit ) . toEqual ( [ `${ harness . repoDir } \tsync` ] )
520+ expect ( planToGit ) . toEqual ( [
521+ `${ harness . repoDir } \timport-codex --no-sync` ,
522+ `${ harness . repoDir } \tsync`
523+ ] )
515524 } )
516525 ) . pipe ( Effect . provide ( NodeContext . layer ) ) )
517526
@@ -529,7 +538,10 @@ describe("git post-push wrapper", () => {
529538 const gh = yield * _ ( readLogLines ( harness . ghLogPath ) )
530539
531540 expect ( nodeScript ) . toEqual ( [ "backup --verbose --background --require-comment" ] )
532- expect ( planToGit ) . toEqual ( [ `${ harness . repoDir } \tsync` ] )
541+ expect ( planToGit ) . toEqual ( [
542+ `${ harness . repoDir } \timport-codex --no-sync` ,
543+ `${ harness . repoDir } \tsync`
544+ ] )
533545 expect ( gh ) . toContain ( `${ harness . repoDir } \tpr list --repo org/repo --state open --head issue-375 --json url --jq .[0].url // ""` )
534546 expect ( gh . some ( ( line ) => line . includes ( "pr create" ) ) ) . toBe ( false )
535547 } )
0 commit comments