High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
fix: correct ProfileManager field reference in handlers.go
Mario6d5769d25fe2
diff --git a/internal/orchestrator/handlers.go b/internal/orchestrator/handlers.goindex d5157d84..5604fdf2 100644--- a/internal/orchestrator/handlers.go+++ b/internal/orchestrator/handlers.go@@ -162,10 +162,14 @@ func (o *Orchestrator) handleLaunchByName(w http.ResponseWriter, r *http.Requestvar name stringif req.ProfileId != "" {// Look up profile by ID to get its name- profs := o.pm.List()+ profs, err := o.profiles.List()+ if err != nil {+ web.Error(w, 500, fmt.Errorf("failed to list profiles: %w", err))+ return+ }found := falsefor _, p := range profs {- if p.Id == req.ProfileId {+ if p.ID == req.ProfileId {name = p.Namefound = truebreakdiff --git a/memory/2026-03-01-precommit-ci-fix.md b/memory/2026-03-01-precommit-ci-fix.mdnew file mode 100644index 00000000..0a1a9266--- /dev/null+++ b/memory/2026-03-01-precommit-ci-fix.md@@ -0,0 +1,129 @@+# PinchTab: Pre-Commit Framework Integration & Documentation Finalization (2026-03-01 Evening)++## Summary+Completed pre-commit framework integration to fix recurring gofmt CI failures, created comprehensive `DEVELOPMENT.md` for developer onboarding, and finalized documentation restructuring with tabId workflow examples.++## Problems Fixed++### Problem 1: Recurring gofmt CI Failures+**Root cause (two-part):**+1. Project had `.pre-commit-config.yaml` but lacked Go linting hooks+2. Custom `.githooks/pre-commit` was a fallback that wasn't enforced+3. Developers could bypass hooks; gofmt issues only caught in CI after push++**Solution:**+- Added `golangci-lint-full` (v1.55.2, 5m timeout) to `.pre-commit-config.yaml`+- Removed custom `.githooks/` directory (was causing confusion)+- Removed redundant `scripts/format.sh`+- Removed git config `core.hooksPath` setting++**Result:** Developers now run `pip install pre-commit && pre-commit install` once; linting enforced locally before commit, preventing CI failures.++### Problem 2: Unclear Developer Setup+**Issue:** No clear onboarding for:+- How to install pre-commit framework+- What commands to run before committing+- Troubleshooting common setup issues+- Test suite requirements++**Solution:** Created `DEVELOPMENT.md` with:+- **Prerequisites**: Go 1.21+, Python 3.8+, pip+- **Setup steps**: Clone, install pre-commit, enable hooks+- **Running tests**: `go test ./...`, specific test filters+- **Code style**: Pre-commit handles gofmt + golangci-lint automatically+- **Git workflow**: Feature branches, PR reviews+- **Troubleshooting**: "Hook not running?", "Tests failing?", "Pre-commit slow?"+- **CI validation**: What happens in CI, how to debug locally++## Documentation Finalization++### Changes Made+1. **Restructured docs/** (commit `5c1ba89`):+ - Renamed `api-structure-new.md` → `api-structure.md`+ - Removed `cli-implementation.md` (not in final docs)+ - Removed `architecture-overview.md` (merged into pinchtab-architecture.md)+ - Removed "PinchTab" prefixes from cli-design.md and cli-quick-reference.md++2. **Reorganized index.json** (commits `5c1ba89`, `39a3d87`, `a5604fd`):+ - Moved `api-structure.md` to first in references (primary API doc)+ - Moved `configuration.md` to last (less frequently needed)+ - Removed `cli-design.md` from index+ - Removed `showcase.md` from main index (endpoints need review)+ - Removed `architecture-overview.md`++3. **Updated showcase.md** (commit `72ddb85`):+ - Fixed all 5 workflows to use explicit `tabId` throughout+ - Workflow 1 (Text Extraction) → captures and uses tabId+ - Workflow 2 (Snapshot + Click) → uses tabId in all operations+ - Workflow 3 (Form Filling) → complete script with tabId+ - Workflow 4 (Multi-Tab) → proper tabId handling+ - Workflow 5 (PDF Export) → tabId in pdf/screenshot calls++4. **Updated core guides**:+ - `docs/core-concepts.md` — API examples, 4 workflows, mental model+ - `docs/headless-vs-headed.md` — Orchestrator architecture+ - `docs/guides/multi-instance.md` — API patterns, polling, lazy Chrome init+ - `docs/guides/headed-mode-guide.md` — API endpoints, patterns+ - `docs/guides/common-patterns.md` — Consistent patterns+ - `docs/guides/identifying-instances.md` — Hash-based IDs+ - `docs/get-started.md` — Complete rewrite for orchestrator++## Commits on `feat/make-cli-useful`+- `2c4062d` — Add golangci-lint-full hook to pre-commit-config.yaml+- `7bf436e` — Create DEVELOPMENT.md, cleanup custom hooks+- `72ddb85` — Fix showcase.md workflows with tabId usage+- `5c1ba89` — Restructure documentation files and titles+- `39a3d87` — Remove cli-design.md from index+- `a5604fd` — Remove showcase.md from index (pending endpoint review)++## Current State++### Branch Status+- **Branch**: `feat/make-cli-useful` (fully synced with origin)+- **Test status**: All 202 unit tests passing+- **Pre-commit status**: All hooks passing locally+- **CI status**: No gofmt failures (fixed by pre-commit framework)++### Files Changed+- `.pre-commit-config.yaml` — Added golangci-lint-full hook+- `DEVELOPMENT.md` — New developer onboarding guide (2935 bytes)+- Deleted: `.githooks/` directory, `scripts/format.sh`, git config `core.hooksPath`+- Documentation: 7 guide files updated, index.json reorganized++### Documentation State+- 19 files indexed (down from 23 at earlier in session)+- All examples use orchestrator routing (`/instances/{id}/...`)+- All workflows show explicit `tabId` usage+- Instance API endpoints clearly documented+- Profile endpoints documented+- Lazy Chrome initialization patterns shown with polling examples++### Developer Onboarding+New developers should now:+1. Run `pip install pre-commit && pre-commit install`+2. Run `go test ./...` to verify setup+3. Code and commit — pre-commit hooks run automatically+4. If hooks fail: Check `DEVELOPMENT.md` Troubleshooting section++## Next Steps (Blocking PR Review)+1. Merge `feat/make-cli-useful` to main+2. Notify developers: "Update DEVELOPMENT.md setup" in contribution guidelines+3. Verify on secondary machine: Fresh clone → pre-commit install → tests pass+4. Monitor CI on first few commits after merge to confirm no gofmt failures++## Long-Term Improvements+1. Scan remaining guides for outdated patterns (CDP, configuration)+2. When showcase.md is ready (endpoints verified), update index.json to re-include+3. Consider phase 2: Shell completion, REPL mode, structured CLI output+4. Document: Why pre-commit framework (industry standard, not custom hooks)++## Key Learnings+- **Pre-commit framework is the standard** — More maintainable than custom git hooks+- **Local validation > CI catches** — Developers should see failures before push+- **Documentation + tooling = developer success** — Clear setup + working examples = adoption+- **Explicit patterns beat implicit defaults** — tabId must be explicit, not implicit first-tab+- **Organized docs help** — 31 KB of clear patterns beats 100 KB of scattered info++---++**Session Summary**: Moved from "fixing CI after push" to "preventing issues locally". Project is now ready for broader team adoption with clear setup, good examples, and comprehensive dev guide.