Repository navigation
Pass the native Work record specs on Go: Pi native MCP, routine confirmation cards, gated fixture tool - #93
Conversation
…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>
…ools' into devin/work-records-go-v2
…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>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
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)
| for key, value := range in.Config.Options { | ||
| if !offered(native, effort, key, value) { | ||
| return &WorkError{Code: "BAD_REQUEST", Message: "请先读取此模型的原生配置,再选择可用值。"} | ||
| } |
There was a problem hiding this comment.
🔴 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| 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) |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| 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) |
There was a problem hiding this comment.
🟥 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
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
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
5 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| args = append(args, "--extension", path) | ||
| } | ||
| return args, nil | ||
| return append(args, "--extension", "builtin:mcp"), nil |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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 reloadmonitoring stays quiet, delivers one result and opens the native Work recordThere is no
work.recordsprocedure to port. The Work panel builds its records fromChatView.messages(grouped byturnId),runsandactiveTurnId, 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 aspackages/agent/src/harness/worker.mjs:--no-extensions --extension builtin:tool-search <extensions…> --extension builtin:mcp. Before this, Pi never loadedbuiltin:mcp, soroutine_createand the other product tools were never callable asmcp__persona__*.internal/cli/serve.go:-pi-extensioncan be repeated, because--no-extensionsalso turns off the agent dir's auto-discovered extensions.internal/routines/confirm.go(new):Service.Confirmshows the routine card the wayRoutines.manageinpackages/agent/src/work/routines.tsdoes:routine_createandroutine_manageno longer setMutates, so the generictool:<id>/routine_createcard 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.servewiresroutineSvc.Confirm = approvals.Request. The card labels stay Chinese, as TS hard-codes them.internal/agent(projection): messages of a conditional routine run are stored withhidden: trueand aroutinesource, asprojection.tsmarks its drafts. Before, only the chat view hid them (applyRoutineDelivery), sobotPreviewread the silent run's internal reply and the sidebar preview changed after anotify: falserun. TS keeps the previous preview.TestRuntimeConditionalRoutineRunKeepsPreviewcovers conditional (preview unchanged) and always-delivered runs (preview is the reply).Fixture and web
apps/api/test/fixtures/go-server.ts: a generatedfixture_echoPi extension stands in forweb-server.ts's gated test tool.gate-toolholds the tool itself through the double's/toolendpoint (TS parity) instead of the model request after Pi'sls. Scripted product tool calls are renamed tomcp__persona__<name>when Pi declares them. Main'sstartServicedata-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'spointerup. Keeps Shrink Go Playwright gaps: computer stubs, Pi model controls, fixture scripting #88'sinputinterruption.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 againstmaincontains its commits too. Main through #88 is merged in.Verification
PERSONA_WEB_SERVER=go: 10/10 each (--repeat-each 10), after the latest main merge.xvfb-run -a pnpm test(before the preview fix): 434 passed, 48 skipped, 1 failed (Cua release: HTTP 403inharness-process.test.ts, environment).go build ./...,go vet ./...,go test ./...,gofmt -l .andgolangci-lint runare clean.pnpm typecheckis clean;pnpm linthas 0 errors and the existing 8 warnings.The Go browser spot check passed both Work record flows.
Implemented in session Serve work.records in Go
Review with Devin · Open in Devin Desktop