Repository navigation
feat(walkthrough): build the change walkthrough in a spawned agent session #435
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
+3,509
−4,859
Merged
Changes from all commits
Commits
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
36 changes: 36 additions & 0 deletions
36
backend/src/db/migrations/202610151200-change-walkthrough-sessions.ts
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 |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import type { Migration } from '../migration-runner' | ||
|
|
||
| const migration: Migration = { | ||
| id: '202610151200-change-walkthrough-sessions', | ||
| up(db) { | ||
| const columns = db.prepare('PRAGMA table_info(change_walkthroughs)').all() as Array<{ name: string }> | ||
| if (columns.some((column) => column.name === 'generation_id')) { | ||
| return | ||
| } | ||
|
|
||
| db.run('DROP TABLE IF EXISTS change_walkthroughs') | ||
| db.run(` | ||
| CREATE TABLE change_walkthroughs ( | ||
| session_id TEXT NOT NULL, | ||
| source_key TEXT NOT NULL, | ||
| diff_hash TEXT NOT NULL, | ||
| generation_id TEXT NOT NULL, | ||
| walkthrough_session_id TEXT, | ||
| status TEXT NOT NULL, | ||
| artifact_path TEXT, | ||
| published_at INTEGER, | ||
| error TEXT, | ||
| model TEXT, | ||
| created_at INTEGER NOT NULL, | ||
| updated_at INTEGER NOT NULL, | ||
| PRIMARY KEY (session_id, source_key) | ||
| ) | ||
| `) | ||
| db.run('CREATE INDEX change_walkthroughs_walkthrough_session ON change_walkthroughs(walkthrough_session_id)') | ||
| }, | ||
| down(db) { | ||
| db.run('DROP TABLE IF EXISTS change_walkthroughs') | ||
| }, | ||
| } | ||
|
|
||
| export default migration |
22 changes: 22 additions & 0 deletions
22
backend/src/db/migrations/202610161200-change-walkthrough-execution.ts
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 |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import type { Migration } from '../migration-runner' | ||
|
|
||
| interface ColumnInfo { | ||
| name: string | ||
| } | ||
|
|
||
| const migration: Migration = { | ||
| id: '202610161200-change-walkthrough-execution', | ||
|
|
||
| up(db) { | ||
| const columns = db.prepare('PRAGMA table_info(change_walkthroughs)').all() as ColumnInfo[] | ||
| if (!columns.some((column) => column.name === 'execution_started_at')) { | ||
| db.run('ALTER TABLE change_walkthroughs ADD COLUMN execution_started_at INTEGER') | ||
| } | ||
| }, | ||
|
|
||
| down(db) { | ||
| void db | ||
| }, | ||
| } | ||
|
|
||
| export default migration |
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
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.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: chriswritescode-dev/opencode-manager
Length of output: 1820
Update
ensureChangeWalkthroughTableto create the current schema.202610061701-change-walkthroughscalls this helper, so a database initialized through that migration can receive the legacy four-column table. The current walkthrough operations require the newer lifecycle columns and can fail withno such columnwhen the later schema migration has not run.Update the helper to match migration
202610151200, including its index andexecution_started_at. Do not remove the helper without also updating the migration that calls it.🤖 Prompt for AI Agents