源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
This commit is contained in:
commit
2ed3415fb7
8018 files changed
+1936476
No files matched your search
@@ -0,0 +1,108 @@
|
||||
package agentruntime
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestProviderTurnBindingHooksOwnForkability(t *testing.T) {
|
||||
t.Parallel()
|
||||
claude := new(ClaudeCodeSDKAdapter)
|
||||
started, err := claude.WriteProviderTurnBinding(
|
||||
ProviderTurnBindingWriteInput{
|
||||
Kind: ProviderTurnBindingWriteStarted,
|
||||
ProviderTurnID: "claude-prompt",
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
forkable, err := claude.CanForkProviderTurn(
|
||||
t.Context(),
|
||||
ProviderTurnForkabilityInput{
|
||||
ProviderTurnID: "claude-prompt",
|
||||
ProviderTurnBindingJSON: started,
|
||||
},
|
||||
)
|
||||
if err != nil || forkable {
|
||||
t.Fatalf("Claude started binding forkable=%v error=%v", forkable, err)
|
||||
}
|
||||
checkpoint, err := claude.WriteProviderTurnBinding(
|
||||
ProviderTurnBindingWriteInput{
|
||||
Kind: ProviderTurnBindingWriteCheckpoint,
|
||||
ProviderTurnID: "claude-prompt",
|
||||
Payload: map[string]any{
|
||||
"checkpointMessageId": "claude-answer",
|
||||
},
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
forkable, err = claude.CanForkProviderTurn(
|
||||
t.Context(),
|
||||
ProviderTurnForkabilityInput{
|
||||
ProviderTurnID: "claude-prompt",
|
||||
ProviderTurnBindingJSON: checkpoint,
|
||||
},
|
||||
)
|
||||
if err != nil || !forkable {
|
||||
t.Fatalf("Claude checkpoint binding forkable=%v error=%v", forkable, err)
|
||||
}
|
||||
|
||||
codex := new(CodexAppServerAdapter)
|
||||
binding, err := codex.WriteProviderTurnBinding(
|
||||
ProviderTurnBindingWriteInput{
|
||||
Kind: ProviderTurnBindingWriteStarted,
|
||||
ProviderTurnID: "codex-turn",
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
forkable, err = codex.CanForkProviderTurn(
|
||||
t.Context(),
|
||||
ProviderTurnForkabilityInput{
|
||||
ProviderTurnID: "codex-turn",
|
||||
ProviderTurnBindingJSON: binding,
|
||||
},
|
||||
)
|
||||
if err != nil || !forkable {
|
||||
t.Fatalf("Codex binding forkable=%v error=%v", forkable, err)
|
||||
}
|
||||
|
||||
tuttiAgent := NewTuttiAgentAppServerAdapterWithHostMetadata(
|
||||
nil,
|
||||
LegacyHostMetadata(),
|
||||
)
|
||||
tuttiBinding, err := tuttiAgent.WriteProviderTurnBinding(
|
||||
ProviderTurnBindingWriteInput{
|
||||
Kind: ProviderTurnBindingWriteStarted,
|
||||
ProviderTurnID: "tutti-turn",
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
forkable, err = tuttiAgent.CanForkProviderTurn(
|
||||
t.Context(),
|
||||
ProviderTurnForkabilityInput{
|
||||
ProviderTurnID: "tutti-turn",
|
||||
ProviderTurnBindingJSON: tuttiBinding,
|
||||
},
|
||||
)
|
||||
if err != nil || !forkable {
|
||||
t.Fatalf("Tutti Agent binding forkable=%v error=%v", forkable, err)
|
||||
}
|
||||
|
||||
forkable, err = codex.CanForkProviderTurn(
|
||||
t.Context(),
|
||||
ProviderTurnForkabilityInput{
|
||||
ProviderTurnID: "codex-turn",
|
||||
ProviderTurnBindingJSON: json.RawMessage(`{}`),
|
||||
},
|
||||
)
|
||||
if err != nil || forkable {
|
||||
t.Fatalf("historical empty binding forkable=%v error=%v", forkable, err)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user