codex making invalid PHP import statement change (`use Illuminate\Support\Facades\DB;` -> `use Illuminate\Support\Facades.DB;`)

Resolved 💬 2 comments Opened Nov 20, 2025 by frankslin Closed Nov 20, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.58.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.1-codex (reasoning none, summaries auto)

What platform is your computer?

Linux 6.8.0-87-generic x86_64 x86_64

What issue are you seeing?

Codex made an incorrect PHP import update (use Illuminate\Support\Facades\DB; -> use Illuminate\Support\Facades.DB;).

› $ php artisan migrate:rollback --step=1

  In 2025_11_20_094916_add_admin_cat_code_to_addr_codes_table.php line 7:

    The use statement with non-compound name 'RuntimeException' has no effect


• Explored
  └ Read 2025_11_20_094916_add_admin_cat_code_to_addr_codes_table.php

• Edited database/migrations/2025_11_20_094916_add_admin_cat_code_to_addr_codes_table.php (+1 -2)
    4  use Illuminate\Database\Migrations\Migration;
    5 -use Illuminate\Support\Facades\DB;
    5 +use Illuminate\Support\Facades.DB;
    6  use Illuminate\Support\Facades\Schema;
    7 -use RuntimeException;
    7

• Edited database/migrations/2025_11_20_094916_add_admin_cat_code_to_addr_codes_table.php (+1 -1)
    88          if ($defaultCode === null) {
    89 -            throw new RuntimeException('ADMIN_CAT_CODES is empty; seed it before adding the
        foreign key constraint.');
    89 +            throw new \RuntimeException('ADMIN_CAT_CODES is empty; seed it before adding the
         foreign key constraint.');
    90          }

• Ran git status -sb
  └ ## develop...origin/develop
     M database/migrations/2025_11_20_094916_add_admin_cat_code_to_addr_codes_table.php
    ?? database/real_database.sqlite3

─ Worked for 23s 
...

What steps can reproduce the bug?

Unfortunately, I haven't found a reliably way to repro this. I can confirm that this is the second time I see a similar change recently made by codex to PHP import statements.

What is the expected behavior?

The line 5 of the diff shouldn't have occurred:

• Edited database/migrations/2025_11_20_094916_add_admin_cat_code_to_addr_codes_table.php (+1 -2)
    4  use Illuminate\Database\Migrations\Migration;
    5 -use Illuminate\Support\Facades\DB;
    5 +use Illuminate\Support\Facades.DB;
    6  use Illuminate\Support\Facades\Schema;
    7 -use RuntimeException;
    7

Additional information

_No response_

View original on GitHub ↗

2 Comments

Tom-CDA · 9 months ago

Ha i've had this one as well one time, so it does happen

etraut-openai contributor · 9 months ago

Thanks for the bug report. We'll share the feedback with the team responsible for training our codex models. If you see other model behavior that you'd like to report, please use the /feedback command in the CLI. That will provide us with additional details including logs and conversation text.