Skip to content

Pass the native Work record specs on Go: Pi native MCP, routine confirmation cards, gated fixture tool - #93

Merged
devin-ai-integration[bot] merged 20 commits into
mainfrom
devin/work-records-go-v2
Nov 24, 2026
Merged

devin-ai-integration[bot] merged 20 commits into
mainfrom
devin/work-records-go-v2

Conversation

@Personed

@Personed Personed commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Un-excludes the two native Work record specs in apps/web/test/go-gaps.ts:

  • Work follows a native turn, opens its record and preserves it after stop and reload
  • monitoring stays quiet, delivers one result and opens the native Work record

There is no work.records procedure to port. The Work panel builds its records from ChatView.messages (grouped by turnId), runs and activeTurnId, and Go already projects those. The specs failed because of how Go launches Pi, how routine changes are confirmed, and differences in the fixture.

Go

  • internal/engine/pi: Pi now starts with the same extensions as packages/agent/src/harness/worker.mjs: --no-extensions --extension builtin:tool-search <extensions…> --extension builtin:mcp. Before this, Pi never loaded builtin:mcp, so routine_create and the other product tools were never callable as mcp__persona__*.
  • internal/cli/serve.go: -pi-extension can be repeated, because --no-extensions also turns off the agent dir's auto-discovered extensions.
  • internal/routines/confirm.go (new): Service.Confirm shows the routine card the way Routines.manage in packages/agent/src/work/routines.ts does:
    approval.Request{ID: "routine:" + callID, Title: "创建定时:" + title, Detail: instructions,
        Kind: Permission, ConfirmLabel: "创建任务",
        Fields: 执行时间 / 时区 / 执行期限 / 交付方式 [/ 使用技能], update shows only changed "old → new"}
    routine_create and routine_manage no longer set Mutates, so the generic tool:<id> / routine_create card no longer appears. A declined change returns {"status":"declined"}. Repeated request IDs, NOT_FOUND, revision conflicts and schedule validation are checked before the card is shown, as in TS. serve wires routineSvc.Confirm = approvals.Request. The card labels stay Chinese, as TS hard-codes them.
  • internal/agent (projection): messages of a conditional routine run are stored with hidden: true and a routine source, as projection.ts marks its drafts. Before, only the chat view hid them (applyRoutineDelivery), so botPreview read the silent run's internal reply and the sidebar preview changed after a notify: false run. TS keeps the previous preview. TestRuntimeConditionalRoutineRunKeepsPreview covers conditional (preview unchanged) and always-delivered runs (preview is the reply).

Fixture and web

  • apps/api/test/fixtures/go-server.ts: a generated fixture_echo Pi extension stands in for web-server.ts's gated test tool. gate-tool holds the tool itself through the double's /tool endpoint (TS parity) instead of the model request after Pi's ls. Scripted product tool calls are renamed to mcp__persona__<name> when Pi declares them. Main's startService data-directory retry is kept.
  • apps/web/src/features/shell/workspace.tsx: during a press, skips the view transitions React queues after the one being skipped, so the transition no longer captures the click's pointerup. Keeps Shrink Go Playwright gaps: computer stubs, Pi model controls, fixture scripting #88's input interruption.
  • workspace.spec.ts: the stop step waits for the model request (wait-model) before clicking stop. chat.spec.ts (message insertion moves typing…): polls until the typing row's exit frames are sampled. No assertions changed.

Stacking: this branch includes #89 (devin/1795461052-go-server-gaps), so until it merges the diff against main contains its commits too. Main through #88 is merged in.

Verification

  • Both Work specs with PERSONA_WEB_SERVER=go: 10/10 each (--repeat-each 10), after the latest main merge.
  • Full E2E (build + Playwright under Xvfb): Go 77/77; default TypeScript 98/98.
  • xvfb-run -a pnpm test (before the preview fix): 434 passed, 48 skipped, 1 failed (Cua release: HTTP 403 in harness-process.test.ts, environment).
  • go build ./..., go vet ./..., go test ./..., gofmt -l . and golangci-lint run are clean. pnpm typecheck is clean; pnpm lint has 0 errors and the existing 8 warnings.

The Go browser spot check passed both Work record flows.


Poke opened this PR for Stoltembergg
Implemented in session Serve work.records in Go
Review with Devin · Open in Devin Desktop


Personed and others added 12 commits November 23, 2026 18:45
…ture scripting

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…e fixture

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… flow

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…n cards, gated fixture tool

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…xit sample

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

Devin Review found 4 potential issues.

3 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Comment on lines +232 to +235
for key, value := range in.Config.Options {
if !offered(native, effort, key, value) {
return &WorkError{Code: "BAD_REQUEST", Message: "请先读取此模型的原生配置,再选择可用值。"}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 O nível de raciocínio salvo não é aplicado pelo Pi

Ao mudar o nível de raciocínio, a interface salva a escolha. O runtime não a envia ao Pi, que continua usando seu próprio nível.

Learn more

O seletor envia thinkingLevel como opção do modelo por engines.select. A configuração salva a opção em EngineDoc. Ao iniciar um turno, o runtime passa o modelo, mas deixa SessionOptions.ThinkingLevel vazio. A sessão do Pi só aplica um nível explícito quando esse campo está preenchido.

Example: Com o Pi configurado para usar esforço baixo, o usuário escolhe esforço alto e envia uma mensagem. A interface mostra a escolha salva, mas o turno não pede esforço alto ao Pi.

Recommended fix: Preencha SessionOptions.ThinkingLevel com o valor validado de config.Options["thinkingLevel"] no runtime nativo. Cubra a seleção seguida de envio com um teste que inspecione as opções da sessão ou o comando set_thinking_level, não apenas o documento salvo.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +437 to +443
for _, request := range view.approvals {
if message := pendingApproval(request, turnID); message != nil {
chat.Messages = append(chat.Messages, message)
chat.Approvals = append(chat.Approvals, request)
}
}
chat.Processing = running && len(chat.Approvals) == 0 && (view.live.Generation != nil || pendingTool)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Aprovações ficam pendentes após reinício abrupto

Se o serviço cair durante uma aprovação, o chat restaura o cartão, mas o serviço de aprovação rejeita a resposta. O cartão continua pendente e esconde o indicador de atividade dos turnos seguintes.

Learn more

O serviço de aprovação grava o cartão no banco e espera a resposta em memória. Uma queda perde essa espera, mas conserva o cartão. A recuperação de turnos marca a execução interrompida como incerta sem reconciliar seus cartões. O RPC de resposta continua exigindo a espera em memória. Como a projeção usa todo cartão gravado para calcular Processing, uma aprovação órfã também afeta mensagens novas.

Example: O Bot pede confirmação para criar um relatório diário. O serviço cai antes da resposta. Após reiniciar, tanto aprovar quanto recusar falha, e uma nova pergunta ao Bot não mostra o indicador de resposta.

Recommended fix: Faça o serviço de aprovação expirar solicitações órfãs antes de aceitar novos turnos. Remova cada solicitação pendente e grave seu estado terminal na mesma transação, seguindo settle. Teste o reinício com uma aprovação pendente e depois envie um turno novo.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread internal/agent/runtime.go
Comment on lines +754 to +759
var answer approval.Answer
if r.approvals != nil && request.ID != "" {
answer, _ = r.approvals.Request(ctx, bot, request)
}
response, _ := json.Marshal(piAnswer(request, answer))
_ = session.Answer(context.WithoutCancel(ctx), request.ID, response)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟥 A aprovação de um Bot remoto libera ações no computador do serviço

Ao aprovar um comando ou uma gravação de um Bot remoto, o usuário libera a ação no computador do serviço. A sessão do Pi é aberta localmente, sem usar o computador vinculado.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread internal/routines/confirm.go Resolved
Personed and others added 6 commits November 23, 2026 21:42
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… silent runs keep the Bot preview

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

# Conflicts:
#	AGENTS.md
#	apps/api/test/fixtures/go-server.ts
#	apps/web/test/go-gaps.ts
#	internal/routines/routines.go
#	internal/routines/routines_test.go
#	internal/routines/tools.go

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

5 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

args = append(args, "--extension", path)
}
return args, nil
return append(args, "--extension", "builtin:mcp"), nil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Mudança de prazo da rotina oculta na confirmação

Ao alterar pelo chat o prazo de 60 para 90 segundos, o cartão reduz ambos os valores a um minuto. A comparação omite o campo, e o usuário pode aprovar a mudança sem ver o novo prazo.

Learn more

O chat chama routine_manage, que aceita o prazo em milissegundos. Ao preparar o cartão, requestFields divide o prazo por 60.000 com aritmética inteira. Em seguida, diffFields compara os textos e descarta os campos iguais. O executor de rotinas lê o prazo em milissegundos e interrompe a execução pelo valor real, não pelo valor exibido no cartão.

Example: Uma rotina tem prazo de 60 segundos. O usuário pede 90 segundos pelo chat. O cartão representa ambos como um minuto e não mostra a alteração, mas, após a aprovação, a rotina passa a ter 90 segundos.

Recommended fix: Formate o prazo em requestFields sem descartar segundos ou milissegundos. Acrescente um teste de confirmação que altere apenas o prazo de 60 para 90 segundos e verifique que o cartão mostra os dois valores.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot merged commit b9a90f5 into main Nov 24, 2026
22 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the devin/work-records-go-v2 branch November 24, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant