chore: fork — remove vendor CI, repoint release checks to Neuron Gitea
This commit is contained in:
@@ -1816,19 +1816,6 @@ describe("SessionNs.getUsage", () => {
|
||||
expect(result.cost).toBe(3 + 1.5)
|
||||
})
|
||||
|
||||
test("uses authoritative Copilot billed cost when provided", () => {
|
||||
const result = SessionNs.getUsage({
|
||||
model: createModel({
|
||||
context: 100_000,
|
||||
output: 32_000,
|
||||
cost: { input: 3, output: 15, cache: { read: 0.3, write: 0.3 } },
|
||||
}),
|
||||
usage: usage({ inputTokens: 11_774, outputTokens: 39, totalTokens: 11_813 }),
|
||||
metadata: { copilot: { totalNanoAiu: 4_473_525_000 } },
|
||||
})
|
||||
|
||||
expect(result.cost).toBe(0.04473525)
|
||||
})
|
||||
|
||||
test("uses matching context cost tier before over-200k fallback", () => {
|
||||
const model = createModel({
|
||||
|
||||
@@ -504,56 +504,6 @@ describe("session.llm.ai-sdk adapter", () => {
|
||||
expect(result.tokens.cache.read).toBe(200)
|
||||
})
|
||||
|
||||
test("captures Copilot billed usage from raw Anthropic message deltas per step", async () => {
|
||||
const events = await adapt([
|
||||
uncheckedAdapterEvent({
|
||||
type: "raw",
|
||||
rawValue: {
|
||||
type: "message_delta",
|
||||
copilot_usage: { total_nano_aiu: 4_473_525_000 },
|
||||
},
|
||||
}),
|
||||
{
|
||||
type: "finish-step",
|
||||
response: { id: "msg_test", timestamp: new Date(0), modelId: "claude-sonnet-4.6" },
|
||||
finishReason: "stop",
|
||||
rawFinishReason: "end_turn",
|
||||
usage: {
|
||||
inputTokens: 11_774,
|
||||
outputTokens: 39,
|
||||
totalTokens: 11_813,
|
||||
inputTokenDetails: { noCacheTokens: 3, cacheReadTokens: 0, cacheWriteTokens: 11_771 },
|
||||
outputTokenDetails: { textTokens: 39, reasoningTokens: undefined },
|
||||
},
|
||||
providerMetadata: { anthropic: { cacheCreationInputTokens: 11_771 } },
|
||||
},
|
||||
{
|
||||
type: "finish-step",
|
||||
response: { id: "msg_follow_up", timestamp: new Date(0), modelId: "claude-sonnet-4.6" },
|
||||
finishReason: "stop",
|
||||
rawFinishReason: "end_turn",
|
||||
usage: {
|
||||
inputTokens: 1,
|
||||
outputTokens: 1,
|
||||
totalTokens: 2,
|
||||
inputTokenDetails: { noCacheTokens: 1, cacheReadTokens: 0, cacheWriteTokens: 0 },
|
||||
outputTokenDetails: { textTokens: 1, reasoningTokens: undefined },
|
||||
},
|
||||
providerMetadata: { anthropic: {} },
|
||||
},
|
||||
])
|
||||
|
||||
expect(events[0]).toMatchObject({
|
||||
type: "step-finish",
|
||||
providerMetadata: {
|
||||
anthropic: { cacheCreationInputTokens: 11_771 },
|
||||
copilot: { totalNanoAiu: 4_473_525_000 },
|
||||
},
|
||||
})
|
||||
expect(events[1]).toMatchObject({ type: "step-finish", providerMetadata: { anthropic: {} } })
|
||||
if (events[1].type !== "step-finish") throw new Error("expected step-finish")
|
||||
expect(events[1].providerMetadata?.copilot).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
||||
type Capture = {
|
||||
|
||||
@@ -84,30 +84,23 @@ const it = testEffect(
|
||||
)
|
||||
|
||||
describe("session.system", () => {
|
||||
test("selects the Meta prompt for Muse Spark model IDs", () => {
|
||||
for (const id of ["meta/muse-spark-preview", "muse-spark-1.1", "muse-spark-1.2"]) {
|
||||
const prompt = SystemPrompt.provider({ api: { id } } as Provider.Model)[0]
|
||||
expect(prompt).toContain("powered by Muse Spark,")
|
||||
expect(prompt).toContain("using Meta Muse Spark.")
|
||||
expect(prompt).not.toContain("{{MODEL_NAME}}")
|
||||
test("uses the Neuron prompt for every model", () => {
|
||||
const models = [
|
||||
{ providerID: "meta", api: { id: "muse-spark-preview" } },
|
||||
{ providerID: "moonshotai", api: { id: "k3" } },
|
||||
{ providerID: "anthropic", api: { id: "claude-sonnet-4-6" } },
|
||||
{ providerID: "openai", api: { id: "gpt-5.2" } },
|
||||
{ providerID: "google", api: { id: "gemini-3-pro" } },
|
||||
{ providerID: "mystery", api: { id: "unknown-model" } },
|
||||
]
|
||||
for (const model of models) {
|
||||
const prompt = SystemPrompt.provider(model as Provider.Model)
|
||||
expect(prompt).toHaveLength(1)
|
||||
expect(prompt[0]).toContain("You are Neuron")
|
||||
expect(prompt[0]).not.toContain("{{MODEL_NAME}}")
|
||||
}
|
||||
})
|
||||
|
||||
test("selects the Meta prompt for Muse Glimmer model IDs", () => {
|
||||
for (const id of ["meta/muse-glimmer", "meta/muse-glimmer-30b", "muse-glimmer-30b"]) {
|
||||
const prompt = SystemPrompt.provider({ api: { id } } as Provider.Model)[0]
|
||||
expect(prompt).toContain("powered by Muse Glimmer,")
|
||||
expect(prompt).toContain("using Meta Muse Glimmer.")
|
||||
expect(prompt).not.toContain("{{MODEL_NAME}}")
|
||||
}
|
||||
})
|
||||
|
||||
test("selects the Kimi prompt for official provider model IDs", () => {
|
||||
for (const providerID of ["kimi-for-coding", "moonshotai", "moonshotai-cn"]) {
|
||||
const prompt = SystemPrompt.provider({ providerID, api: { id: "k3" } } as Provider.Model)[0]
|
||||
expect(prompt).toContain("# Prompt and Tool Use")
|
||||
}
|
||||
})
|
||||
|
||||
it.effect("skills output is sorted by name and stable across calls", () =>
|
||||
Effect.gen(function* () {
|
||||
|
||||
Reference in New Issue
Block a user