Fix FBI integration gaps: branch ID, user branch, title pipeline#4
Merged
Fix FBI integration gaps: branch ID, user branch, title pipeline#4
Conversation
- db/runs.gleam: insert_run now does a two-step INSERT+UPDATE so branch_name uses the actual auto-increment run ID (claude/run-37) instead of the millisecond timestamp (claude/run-1777542730698). Added branch/mock/mock_scenario params and branch_in_use() helper. mark_finished now updates branch_name and title via COALESCE so renames from the agent propagate back to the DB. - handlers/runs.gleam: create decoder now accepts branch, mock, mock_scenario, force; performs 409 branch-in-use check for explicit branches; fetches settings.global_prompt and passes it through LaunchInput. do_continue likewise passes global_prompt. - worker.gleam: LaunchInput gains global_prompt field; build_preamble now emits preamble.txt (FBI setup instructions: write title to /fbi-state/title, rename claude/run-* branch) and global.txt. - finalizeBranch.sh: reads /fbi-state/title (stripping newlines, capped at 200 chars) and includes it as "title" in result.json. - container_monitor.gleam, reattach.gleam: decode "title" from result.json and populate RunOutcome.title instead of always None. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e69d9a4 to
3200e1a
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fdatoo
added a commit
that referenced
this pull request
Apr 30, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
insert_runnow does a two-step INSERT+UPDATE sobranch_nameisclaude/run-37notclaude/run-1777542730698createhandler now decodesbranch,mock,mock_scenario, andforce; added 409branch_in_usecheck; user-supplied branch is passed through to the DB and container envpreamble.txtinjected into every fresh run instructing Claude to write/fbi-state/titleand renameclaude/run-*branches; also wired upglobal.txtfromsettings.global_promptfinalizeBranch.shnow reads/fbi-state/titleand includes it inresult.json;container_monitorandreattachdecode it;mark_finishedwrites it (and the final branch name) back viaCOALESCETest plan
branch_namein DB isclaude/run-<id>(small integer), not a timestampbranch: "feat/my-feature"— confirm the container starts on that branch and the DB reflects itbranch_in_use; confirmforce: truebypasses ittitlecolumn is populated (Claude writes to/fbi-state/titleper preamble), andbranch_namereflects any rename Claude performedmock=trueandmock_scenarioare persisted anddo_mock_launchis reached🤖 Generated with Claude Code