fix: retry 429 with backoff; switch Tier B/C to claude-sonnet-4-6

- VertexOpenAIClient: retry on 429/503 up to 4 times with exponential
  backoff (2s/4s/8s/16s + jitter), respects Retry-After header
- Tier B/C default: zai-org/glm-5-maas → claude-sonnet-4-6 (much higher
  rate limits, still Vertex MaaS)
- /agent/execute: accept continueTask param to run a follow-up within
  the original task context without starting a fresh session

Made-with: Cursor
This commit is contained in:
2026-03-07 12:25:51 -08:00
parent b16a216e0e
commit 487c13317c
2 changed files with 53 additions and 25 deletions

View File

@@ -359,13 +359,14 @@ app.post('/webhook/gitea', (req: Request, res: Response) => {
const activeSessions = new Map<string, { stopped: boolean }>();
app.post('/agent/execute', async (req: Request, res: Response) => {
const { sessionId, projectId, appName, appPath, giteaRepo, task } = req.body as {
const { sessionId, projectId, appName, appPath, giteaRepo, task, continueTask } = req.body as {
sessionId?: string;
projectId?: string;
appName?: string;
appPath?: string;
giteaRepo?: string;
task?: string;
continueTask?: string; // if set, appended as follow-up to the original task
};
if (!sessionId || !projectId || !appPath || !task) {
@@ -418,8 +419,14 @@ app.post('/agent/execute', async (req: Request, res: Response) => {
return;
}
// If continuing a previous task, combine into a single prompt so the agent
// understands what was already attempted.
const effectiveTask = continueTask
? `Original task: ${task}\n\nFollow-up instruction: ${continueTask}`
: task!;
// Run the streaming agent loop (fire and forget)
runSessionAgent(agentConfig, task, ctx, {
runSessionAgent(agentConfig, effectiveTask, ctx, {
sessionId,
projectId,
vibnApiUrl,